auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public SPageURL resolvePageURL(SPageMapping pageMapping, Map<String, Serializable> context) throws SExecutionException, SAuthorizationException { final List<String> pageAuthorizationRules = pageMapping.getPageAuthorizationRules(); final List<AuthorizationRule> rules = getRules(pageAuthorizationRules); for (AuthorizationRule rule : rules) { if (!rule.isAllowed(context)) { throw new SAuthorizationException("Access to Page or URL with key " + pageMapping.getKey() + " is not allowed"); } } String url = pageMapping.getUrl(); String urlAdapter = pageMapping.getUrlAdapter(); if (urlAdapter != null) { url = getUrlAdapter(urlAdapter).adapt(url, pageMapping.getKey(), context); } return new SPageURL(url, pageMapping.getPageId()); }

Target:
public SPageURL resolvePageURL(SPageMapping pageMapping, Map<String, Serializable> context) throws SExecutionException, SAuthorizationException { final List<String> pageAuthorizationRules = pageMapping.getPageAuthorizationRules(); for (String rule : pageAuthorizationRules) { final AuthorizationRule authorizationRule = authorizationRuleMap.get(rule); if (authorizationRule == null) { throw new SExecutionException("Authorization rule " + rule + " is not known. Cannot check if authorized or not."); } if (!authorizationRule.isAllowed(context)) { throw new SAuthorizationException("Access to Page or URL with key " + pageMapping.getKey() + " is not allowed"); } } String url = pageMapping.getUrl(); String urlAdapter = pageMapping.getUrlAdapter(); if (urlAdapter != null) { url = getUrlAdapter(urlAdapter).adapt(url, pageMapping.getKey(), context); } return new SPageURL(url, pageMapping.getPageId()); }
Source:
protected List<Resource<?>> doListResources() { if (isStale()) { listCache = null; } if (listCache == null) { listCache = new LinkedList<Resource<?>>(); ZipFile zip = null; try { zip = new ZipFile(file); Enumeration<? extends ZipEntry> entries = zip.entries(); while (entries.hasMoreElements()) { listCache.add(getChild(entries.nextElement().getName())); } } catch (IOException io) { throw new ResourceException("Error reading entries of zip file [" + getFullyQualifiedName() + "]", io); } finally { closeQuietily(zip); } } return listCache.isEmpty() ? Collections.<Resource<?>> emptyList() : listCache; }

Target:
protected List<Resource<?>> doListResources() { return getRootEntry().doListResources(); }
Source:
public RecordWriter getWriter() { if (clazz == boolean.class) { return new PrimitiveWriters.PrimitiveBooleanWriter(); } else if (clazz == Boolean.class) { return new PrimitiveWriters.BooleanWriter(); } else if (clazz == byte.class) { return new PrimitiveWriters.PrimitiveByteWriter(); } else if (clazz == Byte.class) { return new PrimitiveWriters.ByteWriter(); } else if (clazz == char.class) { return new PrimitiveWriters.PrimitiveCharWriter(); } else if (clazz == Character.class) { return new PrimitiveWriters.CharWriter(); } else if (clazz == short.class) { return new PrimitiveWriters.PrimitiveShortWriter(); } else if (clazz == Short.class) { return new PrimitiveWriters.ShortWriter(); } else if (clazz.isEnum()) { return new PrimitiveWriters.EnumWriter(); } else if (clazz == int.class) { return new PrimitiveWriters.PrimitiveIntWriter(); } else if (clazz == Integer.class) { return new PrimitiveWriters.IntWriter(); } else if (clazz == long.class) { return new PrimitiveWriters.PrimitiveLongWriter(); } else if (clazz == Long.class) { return new PrimitiveWriters.LongWriter(); } else if (clazz == float.class) { return new PrimitiveWriters.PrimitiveFloatWriter(); } else if (clazz == Float.class) { return new PrimitiveWriters.FloatWriter(); } else if (clazz == double.class) { return new PrimitiveWriters.PrimitiveDoubleWriter(); } else if (clazz == Double.class) { return new PrimitiveWriters.DoubleWriter(); } else if (clazz == byte[].class) { return new PrimitiveWriters.ByteArrayWriter(); } else if (clazz == String.class) { return new PrimitiveWriters.StringWriter(); } throw new IllegalStateException(String.format("Type %s could not be mapped to a writer.", clazz)); }

Target:
public RecordWriter getWriter() { if(clazz.isEnum()) { return new PrimitiveWriters.EnumWriter(); } RecordWriter recordWriter = typeToWriter.get(clazz); if (recordWriter != null) { return recordWriter; } throw new IllegalStateException(String.format("Type %s could not be mapped to a writer.", clazz)); }
Source:
public Map<String, AnalysisProvider<TokenFilterFactory>> getTokenFilters() { return singletonMap("surrogate_merger", SurrogateMergerFilterFactory::new); }

Target:
public Map<String, AnalysisProvider<TokenFilterFactory>> getTokenFilters() { return singletonMap("surrogate_merger", (isettings, env, name, settings) -> new TokenFilterFactory() { @Override public String name() { return name; } @Override public TokenStream create(TokenStream tokenStream) { return new SurrogateMergerFilter(tokenStream); } }); }
Source:
public static org.ovirt.engine.core.common.businessentities.VmPool map(VmPool model, org.ovirt.engine.core.common.businessentities.VmPool template) { org.ovirt.engine.core.common.businessentities.VmPool entity = template != null ? template : new org.ovirt.engine.core.common.businessentities.VmPool(); if (model.isSetId()) { entity.setVmPoolId(GuidUtils.asGuid(model.getId())); } if (model.isSetName()) { entity.setName(model.getName()); } if (model.isSetDescription()) { entity.setVmPoolDescription(model.getDescription()); } if (model.isSetComment()) { entity.setComment(model.getComment()); } if (model.isSetSize()) { entity.setAssignedVmsCount(model.getSize()); } if (model.isSetCluster()) { if (model.getCluster().isSetId()) { entity.setVdsGroupId(GuidUtils.asGuid(model.getCluster().getId())); } else if (model.getCluster().isSetName()) { entity.setVdsGroupName(model.getCluster().getName()); } } if (model.isSetPrestartedVms()) { entity.setPrestartedVms(model.getPrestartedVms()); } if (model.isSetMaxUserVms()) { entity.setMaxAssignedVmsPerUser(model.getMaxUserVms()); } if (model.isSetDisplay() && model.getDisplay().isSetProxy()) { entity.setSpiceProxy("".equals(model.getDisplay().getProxy()) ? null : model.getDisplay().getProxy()); } if (model.isSetType()) { VmPoolType type = VmPoolType.forName(model.getType()); entity.setVmPoolType(type != null ? type : VmPoolType.AUTOMATIC); } return entity; }

Target:
public static org.ovirt.engine.core.common.businessentities.VmPool map(VmPool model, org.ovirt.engine.core.common.businessentities.VmPool template) { org.ovirt.engine.core.common.businessentities.VmPool entity = template != null ? template : new org.ovirt.engine.core.common.businessentities.VmPool(); if (model.isSetId()) { entity.setVmPoolId(GuidUtils.asGuid(model.getId())); } if (model.isSetName()) { entity.setName(model.getName()); } if (model.isSetDescription()) { entity.setVmPoolDescription(model.getDescription()); } if (model.isSetComment()) { entity.setComment(model.getComment()); } if (model.isSetSize()) { entity.setAssignedVmsCount(model.getSize()); } if (model.isSetCluster()) { if (model.getCluster().isSetId()) { entity.setVdsGroupId(GuidUtils.asGuid(model.getCluster().getId())); } else if (model.getCluster().isSetName()) { entity.setVdsGroupName(model.getCluster().getName()); } } if (model.isSetPrestartedVms()) { entity.setPrestartedVms(model.getPrestartedVms()); } if (model.isSetMaxUserVms()) { entity.setMaxAssignedVmsPerUser(model.getMaxUserVms()); } if (model.isSetDisplay() && model.getDisplay().isSetProxy()) { entity.setSpiceProxy("".equals(model.getDisplay().getProxy()) ? null : model.getDisplay().getProxy()); } if (model.isSetType()) { VmPoolType type = VmPoolType.fromValue(model.getType()); entity.setVmPoolType(type != null ? map(type, null) : org.ovirt.engine.core.common.businessentities.VmPoolType.AUTOMATIC); } return entity; }
Source:
protected Object handleRead(Object target, String attributeName, Object value) { if ( initialized ) { throw new IllegalStateException( "EnhancementAsProxyLazinessInterceptor interception on an initialized instance" ); } if ( identifierAttributeNames.contains( attributeName ) ) { return extractIdValue( target, attributeName ); } try { return forceInitialize( target, attributeName ); } finally { initialized = true; } }

Target:
protected Object handleRead(Object target, String attributeName, Object value) { if ( initialized ) { throw new IllegalStateException( "EnhancementAsProxyLazinessInterceptor interception on an initialized instance" ); } if ( identifierAttributeNames.contains( attributeName ) ) { return extractIdValue( target, attributeName ); } return EnhancementHelper.performWork( this, (session, isTempSession) -> { final Object[] writtenValues; final EntityPersister entityPersister = session.getFactory() .getMetamodel() .entityPersister( getEntityName() ); final EntityTuplizer entityTuplizer = entityPersister.getEntityTuplizer(); if ( inLineDirtyChecking && writtenFieldNames != null && !writtenFieldNames.isEmpty() ) { if ( writtenFieldNames.contains( attributeName ) ) { return entityTuplizer.getPropertyValue( target, attributeName ); } writtenValues = new Object[writtenFieldNames.size()]; int index = 0; for ( String writtenFieldName : writtenFieldNames ) { writtenValues[index] = entityTuplizer.getPropertyValue( target, writtenFieldName ); index++; } } else { writtenValues = null; } final Object initializedValue = forceInitialize( target, attributeName, session, isTempSession ); initialized = true; if ( writtenValues != null ) { int index = 0; for ( String writtenFieldName : writtenFieldNames ) { entityTuplizer.setPropertyValue( target, writtenFieldName, writtenValues[index++] ); } writtenFieldNames.clear(); } return initializedValue; }, getEntityName(), attributeName ); }
Source:
private void removeDiskImages() { List<DiskImage> images = DisksFilter.filterImageDisks(getVm().getDiskMap().values(), ONLY_NOT_SHAREABLE, ONLY_ACTIVE); for (DiskImage image : images) { image.setStorageIds(new ArrayList<>(Arrays.asList(getParameters().getStorageDomainId()))); image.setStoragePoolId(getParameters().getStoragePoolId()); } Set<String> allMemoryVolumes = MemoryUtils.getMemoryVolumesFromSnapshots(getVm().getSnapshots()); for (String memoryVolumes : allMemoryVolumes) { if (!StringUtils.isEmpty(memoryVolumes)) { List<Guid> guids = Guid.createGuidListFromString(memoryVolumes); DiskImage memoryDisk = createMemoryDisk(guids.get(2), guids.get(3)); images.add(memoryDisk); DiskImage metadataDisk = createMemoryDisk(guids.get(4), guids.get(5)); images.add(metadataDisk); } } removeVmImages(images); }

Target:
private void removeDiskImages() { List<DiskImage> images = DisksFilter.filterImageDisks(getVm().getDiskMap().values(), ONLY_NOT_SHAREABLE, ONLY_ACTIVE); boolean shouldWipe = false; for (DiskImage image : images) { image.setStorageIds(new ArrayList<>(Arrays.asList(getParameters().getStorageDomainId()))); image.setStoragePoolId(getParameters().getStoragePoolId()); shouldWipe |= image.isWipeAfterDelete(); } Set<String> allMemoryVolumes = MemoryUtils.getMemoryVolumesFromSnapshots(getVm().getSnapshots()); for (String memoryVolumes : allMemoryVolumes) { if (!StringUtils.isEmpty(memoryVolumes)) { List<Guid> guids = Guid.createGuidListFromString(memoryVolumes); DiskImage memoryDisk = createMemoryDisk(guids.get(2), guids.get(3), shouldWipe); images.add(memoryDisk); DiskImage metadataDisk = createMemoryDisk(guids.get(4), guids.get(5), shouldWipe); images.add(metadataDisk); } } removeVmImages(images); }
Source:
private void checkEntityTypeAndServiceUp(Entity entity, Class<? extends Entity> expectedClass) { Assert.assertNotNull(entity); Assert.assertTrue(expectedClass.isAssignableFrom(entity.getClass()), "expected: " + expectedClass + " on interfaces, found: " + entity.getClass().getInterfaces()); EntityTestUtils.assertAttributeEquals(entity, Startable.SERVICE_UP, true); }

Target:
private void checkEntityTypeAndServiceUp(Entity entity, Class<? extends Entity> expectedClass) { Assert.assertNotNull(entity); Assert.assertTrue(expectedClass.isAssignableFrom(entity.getClass()), "expected: " + expectedClass + " on interfaces, found: " + entity.getClass().getInterfaces()); EntityTestUtils.assertAttributeEqualsEventually(entity, Startable.SERVICE_UP, true); }
Source:
public void open() throws InterpreterException { setProperty("zeppelin.python.useIPython", getProperty("zeppelin.pyspark.useIPython", "true")); DepInterpreter depInterpreter = getDepInterpreter(); URL urls = new URL[0]; List<URL> urlList = new LinkedList<>(); if (depInterpreter != null) { SparkDependencyContext depc = depInterpreter.getDependencyContext(); if (depc != null) { List<File> files = depc.getFiles(); if (files != null) { for (File f : files) { try { urlList.add(f.toURI().toURL()); } catch (MalformedURLException e) { LOGGER.error("Error", e); } } } } } String localRepo = getProperty("zeppelin.interpreter.localRepo"); if (localRepo != null) { File localRepoDir = new File(localRepo); if (localRepoDir.exists()) { File[] files = localRepoDir.listFiles(); if (files != null) { for (File f : files) { try { urlList.add(f.toURI().toURL()); } catch (MalformedURLException e) { LOGGER.error("Error", e); } } } } } urls = urlList.toArray(urls); ClassLoader oldCl = Thread.currentThread().getContextClassLoader(); try { URLClassLoader newCl = new URLClassLoader(urls, oldCl); Thread.currentThread().setContextClassLoader(newCl); super.open(); this.sparkInterpreter = getSparkInterpreter(); } finally { Thread.currentThread().setContextClassLoader(oldCl); } if (!useIPython()) { try { bootstrapInterpreter("python/zeppelin_pyspark.py"); } catch (IOException e) { e.printStackTrace(); } } }

Target:
public void open() throws InterpreterException { setProperty("zeppelin.python.useIPython", getProperty("zeppelin.pyspark.useIPython", "true")); DepInterpreter depInterpreter = getDepInterpreter(); URL urls = new URL[0]; List<URL> urlList = new LinkedList<>(); if (depInterpreter != null) { SparkDependencyContext depc = depInterpreter.getDependencyContext(); if (depc != null) { List<File> files = depc.getFiles(); if (files != null) { for (File f : files) { try { urlList.add(f.toURI().toURL()); } catch (MalformedURLException e) { LOGGER.error("Error", e); } } } } } String localRepo = getProperty("zeppelin.interpreter.localRepo"); if (localRepo != null) { File localRepoDir = new File(localRepo); if (localRepoDir.exists()) { File[] files = localRepoDir.listFiles(); if (files != null) { for (File f : files) { try { urlList.add(f.toURI().toURL()); } catch (MalformedURLException e) { LOGGER.error("Error", e); } } } } } urls = urlList.toArray(urls); ClassLoader oldCl = Thread.currentThread().getContextClassLoader(); try { URLClassLoader newCl = new URLClassLoader(urls, oldCl); Thread.currentThread().setContextClassLoader(newCl); super.open(); this.sparkInterpreter = getSparkInterpreter(); } finally { Thread.currentThread().setContextClassLoader(oldCl); } if (!useIPython()) { try { bootstrapInterpreter("python/zeppelin_pyspark.py"); } catch (IOException e) { throw new InterpreterException("Fail to bootstrap pyspark", e); } } }
Source:
public void excludeColumns(String name) throws MaxwellInvalidFilterException { excludeColumns.add(name); }

Target:
public void excludeColumns(String name) throws MaxwellInvalidFilterException { excludeColumns.add(compile(name)); }
Source:
public String getTaskHsitoryList(String taskID) throws JSONException, SQLException { ConvertSprintBacklog csb = new ConvertSprintBacklog(); TaskObject task = TaskObject.get(Long.parseLong(taskID)); List<HistoryObject> taskHistoryList = task.getHistories(); List<String> remainsList = new ArrayList<String>(); String lastRemainsHour = "0"; for (HistoryObject history : taskHistoryList) { String date = parseDate(history.getCreateTime()); lastRemainsHour = task.getRemains(new Date(date)) + ""; remainsList.add(lastRemainsHour); } String taskHistoryJsonString = csb.convertTaskHistory(taskHistoryList, remainsList); return taskHistoryJsonString; }

Target:
public String getTaskHsitoryList(String taskID) throws JSONException, SQLException { ConvertSprintBacklog csb = new ConvertSprintBacklog(); TaskObject task = TaskObject.get(Long.parseLong(taskID)); List<HistoryObject> taskHistories = task.getHistories(); List<String> remainsList = new ArrayList<String>(); String lastRemainsHour = "0"; for (HistoryObject history : taskHistories) { String date = parseDate(history.getCreateTime()); lastRemainsHour = task.getRemains(new Date(date)) + ""; remainsList.add(lastRemainsHour); } String taskHistoryJsonString = csb.convertTaskHistory(taskHistories, remainsList); return taskHistoryJsonString; }
Source:
public Records fetch() throws IOException { int retryCount = 0; final QueryStatistics.Measurer statTracker = new QueryStatistics.Measurer(); statTracker.recordQueryPrepStart(); PreparedStatement preparedStatement = getPreparedStatement(); statTracker.recordQueryPrepEnd(); while (true) { try { statTracker.recordAttempt(); statTracker.recordQueryExecStart(); final Records queryResults = getQueryResults(preparedStatement); statTracker.recordQueryExecEnd(); final QueryStatistics statistics = statTracker.calculate(); queryResults.addStatistics(statistics); try { postQueryAction.perform(statistics); } catch (Exception ignoredException) { LOG.info(String.format("Error occurred running post-query action %s", postQueryAction), ignoredException); } return queryResults; } catch (SQLRecoverableException e) { LOG.error(e.toString()); if (++retryCount > MAX_CONNECTION_RETRIES) { throw new IOException(e); } } catch (SQLException e) { throw new IOException(e); } } }

Target:
public Records fetch() throws IOException { int retryCount = 0; final QueryStatistics.Measurer statTracker = new QueryStatistics.Measurer(); statTracker.recordQueryPrepStart(); PreparedStatement preparedStatement = getPreparedStatement(); statTracker.recordQueryPrepEnd(); while (true) { try { statTracker.recordAttempt(); statTracker.recordQueryExecStart(); final Records queryResults = getQueryResults(preparedStatement); statTracker.recordQueryExecEnd(); final QueryStatistics statistics = statTracker.calculate(); queryResults.addStatistics(statistics); try { postQueryAction.perform(statistics); } catch (Exception ignoredException) { LOG.error(String.format("Error occurred running post-query action %s", postQueryAction), ignoredException); } return queryResults; } catch (SQLRecoverableException e) { LOG.error(e.toString()); if (++retryCount > MAX_CONNECTION_RETRIES) { throw new IOException(e); } } catch (SQLException e) { throw new IOException(e); } } }
Source:
private void writeCheckpointIfNeed() { if (commitNeeded) { throw new IllegalStateException("A checkpoint should only be written if now commit is needed."); } if (checkpoint != null) { stateMgr.checkpoint(checkpoint); checkpoint = null; } }

Target:
private void writeCheckpointIfNeed() { if (commitNeeded) { throw new IllegalStateException("A checkpoint should only be written if no commit is needed."); } if (checkpoint != null) { stateMgr.checkpoint(checkpoint); checkpoint = null; } }
Source:
private Throwable mapError(Throwable throwable, ServiceBusErrorSource errorSource) { if ((throwable instanceof ServiceBusReceiverException) || !(throwable instanceof AmqpException)) { return throwable; } else { return new ServiceBusReceiverException((AmqpException) throwable, errorSource); } }

Target:
private Throwable mapError(Throwable throwable, ServiceBusErrorSource errorSource) { if (!(throwable instanceof ServiceBusReceiverException)) { return new ServiceBusReceiverException(throwable, errorSource); } return throwable; }
Source:
public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException { for (Argument arg : scriptEntry.getProcessedArgs()) { if (!scriptEntry.hasObject("players") && arg.matchesPrefix("to", "players")) { scriptEntry.addObject("players", arg.asType(ListTag.class).filter(PlayerTag.class, scriptEntry)); } else if (arg.matchesPrefix("d", "duration") && arg.matchesArgumentType(DurationTag.class)) { scriptEntry.addObject("duration", arg.asType(DurationTag.class)); } else if (!scriptEntry.hasObject("entity") && arg.matchesArgumentType(EntityTag.class)) { scriptEntry.addObject("entity", arg.asType(EntityTag.class)); } else if (!scriptEntry.hasObject("location") && arg.matchesArgumentType(LocationTag.class)) { scriptEntry.addObject("location", arg.asType(LocationTag.class)); } else { arg.reportUnhandled(); } } if (!scriptEntry.hasObject("players") && Utilities.entryHasPlayer(scriptEntry)) { List<PlayerTag> players = new ArrayList<>(); players.add(Utilities.getEntryPlayer(scriptEntry)); scriptEntry.defaultObject("players", players); } if (!scriptEntry.hasObject("location")) { throw new InvalidArgumentsException("Must specify a valid location!"); } if (!scriptEntry.hasObject("players")) { throw new InvalidArgumentsException("Must have a valid, online player attached!"); } if (!scriptEntry.hasObject("entity")) { throw new InvalidArgumentsException("Must specify a valid entity!"); } scriptEntry.defaultObject("duration", new DurationTag(10)); }

Target:
public void parseArgs(ScriptEntry scriptEntry) throws InvalidArgumentsException { for (Argument arg : scriptEntry.getProcessedArgs()) { if (!scriptEntry.hasObject("players") && arg.matchesPrefix("to", "players")) { scriptEntry.addObject("players", arg.asType(ListTag.class).filter(PlayerTag.class, scriptEntry)); } else if (arg.matchesPrefix("d", "duration") && arg.matchesArgumentType(DurationTag.class)) { scriptEntry.addObject("duration", arg.asType(DurationTag.class)); } else if (!scriptEntry.hasObject("entity") && arg.matchesArgumentType(EntityTag.class)) { scriptEntry.addObject("entity", arg.asType(EntityTag.class)); } else if (!scriptEntry.hasObject("location") && arg.matchesArgumentType(LocationTag.class)) { scriptEntry.addObject("location", arg.asType(LocationTag.class)); } else { arg.reportUnhandled(); } } if (!scriptEntry.hasObject("players") && Utilities.entryHasPlayer(scriptEntry)) { scriptEntry.defaultObject("players", Arrays.asList(Utilities.getEntryPlayer(scriptEntry))); } if (!scriptEntry.hasObject("location")) { throw new InvalidArgumentsException("Must specify a valid location!"); } if (!scriptEntry.hasObject("players")) { throw new InvalidArgumentsException("Must have a valid, online player attached!"); } if (!scriptEntry.hasObject("entity")) { throw new InvalidArgumentsException("Must specify a valid entity!"); } scriptEntry.defaultObject("duration", new DurationTag(10)); }
Source:
protected <P extends Archive<?> & ClassContainer<?>> void processClasses(P archive) { if (classes == null || classes.isEmpty()) { return; } if (isSinglePackage(classes)) { Package classesPackage = null; final List<String> simpleNames = new ArrayList<String>(classes.size()); for (Class<?> clazz : classes) { if (skipClassName(clazz.getName())) { continue; } simpleNames.add(clazz.getSimpleName()); if (classesPackage == null) { classesPackage = clazz.getPackage(); } Asset resource = new ClassAsset(clazz); ArchivePath location = ArchivePaths.create(resolveClassesPath(archive), AssetUtil.getFullPathForClassResource(clazz)); archive.add(resource, location); } archive.addPackages(false, new Filter<ArchivePath>() { @Override public boolean include(ArchivePath path) { String pathStr = path.get(); for (String simpleName : simpleNames) { if (isInnerClassCandidate(simpleName, pathStr)) { return pathStr.matches(String.format(".*%s%s%s.+\\.class", AssetUtil.DELIMITER_RESOURCE_PATH, simpleName, INNER_CLASS_MARKER)); } } return false; } }, classesPackage); } else { for (Class<?> clazz : classes) { if (skipClassName(clazz.getName())) { continue; } archive.addClass(clazz); } } }

Target:
protected <P extends Archive<?> & ClassContainer<?>> void processClasses(P archive) { if (classes == null || classes.isEmpty()) { return; } if (isSinglePackage(classes)) { Package classesPackage = null; final List<String> simpleNames = new ArrayList<String>(classes.size()); for (Class<?> clazz : classes) { if (skipClassName(clazz.getName())) { continue; } simpleNames.add(clazz.getSimpleName()); if (classesPackage == null) { classesPackage = clazz.getPackage(); } Asset resource = new ClassAsset(clazz); ArchivePath location = ArchivePaths.create(resolveClassesPath(archive), AssetUtil.getFullPathForClassResource(clazz)); archive.add(resource, location); } archive.addPackages(false, new Filter<ArchivePath>() { @Override public boolean include(ArchivePath path) { String pathStr = path.get(); for (String simpleName : simpleNames) { if (isInnerClassCandidate(simpleName, pathStr)) { return pathStr.matches(String.format(INNER_CLASS_MATCH_PATTERN_BASE, simpleName)); } } return false; } }, classesPackage); } else { for (Class<?> clazz : classes) { if (skipClassName(clazz.getName())) { continue; } archive.addClass(clazz); } } }
Source:
public void test() throws Exception { final String className = "Example"; final ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES) { @Override protected String getCommonSuperClass(final String type1, final String type2) { computedCommonSuperClass = true; return "java/lang/Object"; } }; cw.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC, className, null, "java/lang/Object", null); final MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "m", "()V", null, null); mv.visitCode(); addCauseOfResizeInstructions(mv); addCauseOfGetCommonSuperClass(mv); mv.visitMaxs(1, 1); mv.visitEnd(); cw.visitEnd(); final byte[] original = cw.toByteArray(); assertEquals(true, computedCommonSuperClass); load(className, original); instrumenter.instrument(original, className); }

Target:
public void test() throws Exception { final String className = "Example"; final ClassWriter cw = new ClassWriter(ClassWriter.COMPUTE_FRAMES) { @Override protected String getCommonSuperClass(final String type1, final String type2) { computedCommonSuperClass |= className.equals(type1) || className.equals(type2); return "java/lang/Object"; } }; cw.visit(Opcodes.V1_5, Opcodes.ACC_PUBLIC, className, null, "java/lang/Object", null); final MethodVisitor mv = cw.visitMethod(Opcodes.ACC_PUBLIC, "m", "()V", null, null); mv.visitCode(); addCauseOfResizeInstructions(mv); addCauseOfGetCommonSuperClass(mv); mv.visitMaxs(1, 1); mv.visitEnd(); cw.visitEnd(); final byte[] original = cw.toByteArray(); assertTrue(computedCommonSuperClass); new TargetLoader().add(className, original); final byte[] instrumented = instrumenter.instrument(original, className); new TargetLoader().add(className, instrumented); }
Source:
public static void getStringAnnotation(QuotedEntityChecker checker, String template, String value) throws Exception { }

Target:
public static OWLAnnotation getStringAnnotation( QuotedEntityChecker checker, String template, String value) throws Exception { return TemplateHelper.getStringAnnotation(checker, template, value); }
Source:
public void addPrivatePackage(String packageName) { String key = hasPrivatePackageHeader() ? Constants.PRIVATE_PACKAGE : Constants.PRIVATEPACKAGE; List<String> packages = getEntries(key, listConverter); packages.add(packageName); setEntries(packages, key); }

Target:
public void addPrivatePackage(String packageName) { String key = hasPrivatePackageInstruction() ? Constants.PRIVATEPACKAGE : Constants.PRIVATE_PACKAGE; List<String> packages = getEntries(key, listConverter); packages.add(packageName); setEntries(packages, key); }
Source:
public List<? extends BoundedSource<KV<K, V>>> splitIntoBundles(long desiredBundleSizeBytes, PipelineOptions options) throws Exception { if (serializableSplit == null) { desiredBundleSizeBytes = Math.max(desiredBundleSizeBytes, ONE_HUNDRED_MB); List<InputSplit> splits = computeSplits(desiredBundleSizeBytes); SOURCE_LOG.info("Got " + splits.size() + " splits."); Collections.shuffle(splits); return Lists.transform(splits, new Function<InputSplit, BoundedSource<KV<K, V>>>() { @Nullable @Override public BoundedSource<KV<K, V>> apply(@Nullable InputSplit inputSplit) { return new HadoopFileSource<K, V>(filepattern, formatClass, keyClass, valueClass, new SerializableSplit(inputSplit), overrideOutputCoder, serializationProperties); } }); } else { return ImmutableList.of(this); } }

Target:
public List<? extends BoundedSource<KV<K, V>>> splitIntoBundles(long desiredBundleSizeBytes, PipelineOptions options) throws Exception { if (serializableSplit == null) { long bundleSizeBytes = Math.max(desiredBundleSizeBytes, MIN_BUNDLE_SIZE_BYTES); List<InputSplit> splits = computeSplits(bundleSizeBytes); SOURCE_LOG.info("Got " + splits.size() + " splits."); Collections.shuffle(splits); return Lists.transform(splits, new Function<InputSplit, BoundedSource<KV<K, V>>>() { @Nullable @Override public BoundedSource<KV<K, V>> apply(@Nullable InputSplit inputSplit) { return new HadoopFileSource<K, V>(filepattern, formatClass, keyClass, valueClass, new SerializableSplit(inputSplit), overrideOutputCoder, serializationProperties); } }); } else { return ImmutableList.of(this); } }
Source:
for (int i = 0; i < extraColumns.size(); i++) { EXTRA_COLUMNS[i] = new GridColumns(extraColumns.get(i).getName(), extraColumns.get(i).getTitle(), extraColumns.get(i).isHidden()); }

Target:
for (int i = 0; i < extraColumns.size(); i++) { JSONColumn columnConfiguration = extraColumns.get(i); EXTRA_COLUMNS[i] = new GridColumns(columnConfiguration.getName(), columnConfiguration.getTitle(), columnConfiguration.isHidden()); }
Source:
public void edit(final GlusterVolumeGeoRepCreateModel object) { driver.edit(object); setSuggestedConfigViolations(object.getRecommendationViolations()); setUserGroupVisibility(false); object.getShowEligibleVolumes().getEntityChangedEvent().addListener(new IEventListener<EventArgs>() { @Override public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { boolean overrideSuggestedConfig = object.getShowEligibleVolumes().getEntity(); if(!overrideSuggestedConfig) { object.getVolumesForForceSessionCreate(); } else { object.getEligibleVolumes(); } } }); IEventListener<EventArgs> clusterEventListener = new IEventListener<EventArgs>() { @Override public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { String selectedCluster = object.getSlaveClusters().getSelectedItem(); List<GlusterVolumeEntity> volumesInCurrentCluster = new ArrayList<GlusterVolumeEntity>(); if(selectedCluster != null) { volumesInCurrentCluster = object.getVolumesInCluster(selectedCluster, object.getVolumeList()); } if(volumesInCurrentCluster.size() > 0) { object.getSlaveVolumes().setItems(volumesInCurrentCluster, volumesInCurrentCluster.get(0)); } else { object.getSlaveVolumes().setItems(volumesInCurrentCluster); } } }; object.getSlaveClusters().getSelectedItemChangedEvent().addListener(clusterEventListener); IEventListener<EventArgs> slaveVolumeEventListener = new IEventListener<EventArgs>() { @Override public void eventRaised(Event<? extends EventArgs> ev, Object sender, EventArgs args) { GlusterVolumeEntity selectedSlaveVolume = object.getSlaveVolumes().getSelectedItem(); Set<String> hostsInCurrentVolume = new HashSet<String>(); if(!object.getShowEligibleVolumes().getEntity() && selectedSlaveVolume != null) { object.updateRecommendatonViolations(); } if(selectedSlaveVolume != null) { hostsInCurrentVolume = object.getHostNamesForVolume(selectedSlaveVolume); } object.getSlaveHosts().setItems(hostsInCurrentVolume); } }; object.getSlaveVolumes().getSelectedItemChangedEvent().addListener(slaveVolumeEventListener); }

Target:
public void edit(final GlusterVolumeGeoRepCreateModel object) { driver.edit(object); setSuggestedConfigViolations(object.getRecommendationViolations()); setUserGroupVisibility(false); }
Source:
public boolean hasTimeEvents() { return fModel instanceof ITimeGraphEntryModel ? ((TimeGraphEntryModel) fModel).hasRowModel() : true; }

Target:
public boolean hasTimeEvents() { return fModel instanceof ITimeGraphEntryModel ? ((ITimeGraphEntryModel) fModel).hasRowModel() : true; }
Source:
public static Collection<CentralProject> data() { closeWelcomeScreen(); List<CentralProject> resultList = new ArrayList<CentralProject>(); new DefaultToolItem(new WorkbenchShell(), CENTRAL_LABEL).click(); centralEditor = new DefaultEditor(CENTRAL_LABEL); centralEditor.activate(); browser = new InternalBrowser(); jsHelper.setBrowser(browser); new WaitWhile(new CentralBrowserIsLoading(), TimePeriod.LONG); AbstractWait.sleep(TimePeriod.DEFAULT); jsHelper.searchFor(SEARCH_STRING); do { String[] examples = jsHelper.getExamples(); for (String exampleName : examples) { if (System.getProperty("specificQuickstarts") == null || System.getProperty("specificQuickstarts").isEmpty() || System.getProperty("specificQuickstarts").contains(exampleName)) { resultList.add(new CentralProject(exampleName, jsHelper.getDescriptionForExample(exampleName))); } } jsHelper.nextPage(); } while (jsHelper.hasNext()); return resultList; }

Target:
public static Collection<CentralProject> data() { closeWelcomeScreen(); List<CentralProject> resultList = new ArrayList<CentralProject>(); new DefaultToolItem(new WorkbenchShell(), CENTRAL_LABEL).click(); centralEditor = new DefaultEditor(CENTRAL_LABEL); centralEditor.activate(); browser = new InternalBrowser(); jsHelper.setBrowser(browser); new WaitWhile(new CentralBrowserIsLoading(), TimePeriod.LONG); jsHelper.searchFor(SEARCH_STRING); do { String[] examples = jsHelper.getExamples(); for (String exampleName : examples) { if (System.getProperty("specificQuickstarts") == null || System.getProperty("specificQuickstarts").isEmpty() || System.getProperty("specificQuickstarts").contains(exampleName)) { resultList.add(new CentralProject(exampleName, jsHelper.getDescriptionForExample(exampleName))); } } jsHelper.nextPage(); } while (jsHelper.hasNext()); return resultList; }
Source:
public static String setUserSessionUserId(final HttpSession session) { String resultUserId; final String hashedUserId = (String) session.getAttribute("USER_ID"); if (hashedUserId == null) { resultUserId = JiraTimetrackerAnalytics.getUserId(); session.setAttribute("USER_ID", resultUserId); } else { resultUserId = hashedUserId; } return resultUserId; }

Target:
public static String setUserSessionUserId(final HttpSession session) { String resultUserId; String hashedUserId = (String) session.getAttribute(USER_ID); if (hashedUserId == null) { resultUserId = JiraTimetrackerAnalytics.getUserId(); session.setAttribute(USER_ID, resultUserId); } else { resultUserId = hashedUserId; } return resultUserId; }
Source:
public Encoding copy() { Encoding copy = new Encoding(); Identified.copyTo(this, copy); copy.advertisingDuration = advertisingDuration; copy.audioBitRate = audioBitRate; copy.audioChannels = audioChannels; copy.audioCoding = audioCoding; copy.availableAt = Sets.newHashSet(Iterables.transform(availableAt, Location.COPY)); copy.bitRate = bitRate; copy.containsAdvertising = containsAdvertising; copy.dataContainerFormat = dataContainerFormat; copy.dataSize = dataSize; copy.distributor = distributor; copy.hasDOG = hasDOG; copy.source = source; copy.videoAspectRatio = videoAspectRatio; copy.videoBitRate = videoBitRate; copy.videoCoding = videoCoding; copy.videoFrameRate = videoFrameRate; copy.videoHorizontalSize = videoHorizontalSize; copy.videoProgressiveScan = videoProgressiveScan; copy.videoVerticalSize = videoVerticalSize; copy.audioDescribed = audioDescribed; return copy; }

Target:
public Encoding copy() { Encoding copy = new Encoding(); Identified.copyTo(this, copy); copy.advertisingDuration = advertisingDuration; copy.audioBitRate = audioBitRate; copy.audioChannels = audioChannels; copy.audioCoding = audioCoding; copy.availableAt = Sets.newHashSet(Iterables.transform(availableAt, Location.COPY)); copy.bitRate = bitRate; copy.containsAdvertising = containsAdvertising; copy.dataContainerFormat = dataContainerFormat; copy.dataSize = dataSize; copy.distributor = distributor; copy.hasDOG = hasDOG; copy.source = source; copy.videoAspectRatio = videoAspectRatio; copy.videoBitRate = videoBitRate; copy.videoCoding = videoCoding; copy.videoFrameRate = videoFrameRate; copy.videoHorizontalSize = videoHorizontalSize; copy.videoProgressiveScan = videoProgressiveScan; copy.videoVerticalSize = videoVerticalSize; copy.audioDescribed = audioDescribed; copy.signed = signed; return copy; }
Source:
private void logManualSync() { String url = preferencesProvider.getGeneralSharedPreferences().getString(GeneralKeys.KEY_SERVER_URL, ""); String urlHash = FileUtils.getMd5Hash(new ByteArrayInputStream(url.getBytes())); analytics.logEvent(AnalyticsEvents.MATCH_EXACTLY_SYNC, "Manual", urlHash); }

Target:
private void logManualSync() { Uri uri = Uri.parse(preferencesProvider.getGeneralSharedPreferences().getString(GeneralKeys.KEY_SERVER_URL, "")); String host = uri.getHost() != null ? uri.getHost() : ""; String urlHash = FileUtils.getMd5Hash(new ByteArrayInputStream(host.getBytes())); analytics.logEvent(AnalyticsEvents.MATCH_EXACTLY_SYNC, "Manual", urlHash); }
Source:
public ProcessExternalPayment deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { JsonObject jsonObject = json.getAsJsonObject(); ProcessExternalPayment.Builder builder = new ProcessExternalPayment.Builder(); builder.setExternalCard(jsonObject.has(MEMBER_MONEY_SOURCE) ? ExternalCardTypeAdapter.getInstance().fromJson(jsonObject.get( MEMBER_MONEY_SOURCE)) : null); Delegate.deserialize(jsonObject, builder); return builder.create(); }

Target:
public ProcessExternalPayment deserialize(JsonElement json, Type typeOfT, JsonDeserializationContext context) throws JsonParseException { JsonObject jsonObject = json.getAsJsonObject(); ProcessExternalPayment.Builder builder = new ProcessExternalPayment.Builder(); JsonElement moneySource = jsonObject.get(MEMBER_MONEY_SOURCE); if (moneySource != null) { builder.setExternalCard(ExternalCardTypeAdapter.getInstance().fromJson(moneySource)); } BaseProcessPaymentTypeAdapter.Delegate.deserialize(jsonObject, builder); return builder.create(); }
Source:
public ObjectFilter withParameters(Map<String, Object> namedParameters) { if (namedParameters == null) { throw new IllegalArgumentException("namedParameters argument cannot be null"); } for (String paramName : getParameterNames()) { if (namedParameters.get(paramName) == null) { throw new IllegalArgumentException("Query parameter '" + paramName + "' was not set"); } } return new AcceptObjectFilter<>(namedParameters, matcher, metadataAdapter, parsingResult); }

Target:
public ObjectFilter withParameters(Map<String, Object> namedParameters) { validateParameters(namedParameters); return new AcceptObjectFilter<>(namedParameters, matcher, metadataAdapter, parsingResult); }
Source:
@Test public void testShouldShowByPlatform() throws Throwable { assertFalse(AnnouncementClient.shouldShow(announcementIOS, "US", dateDuring)); }

Target:
@Test public void testShouldShowByPlatform() throws Throwable { Announcement announcementIOS = announcementList.items().get(ANNOUNCEMENT_IOS); Date dateDuring = dateFormat.parse("2016-11-20"); assertThat(AnnouncementClient.shouldShow(announcementIOS, "US", dateDuring), is(false)); }
Source:
public final void commit (boolean report_heuristics) throws Unavailable, HeuristicMixed, HeuristicHazard, SystemException { try { if (_controlImpl != null) _controlImpl.getImplHandle().commit(report_heuristics); else { Terminator t = null; try { t = _control.get_terminator(); } catch (SystemException e) { throw new Unavailable(); } catch (final NullPointerException ex) { throw new Unavailable(); } if (t != null) t.commit(report_heuristics); else throw new Unavailable(); } } catch (NullPointerException ex) { if (_controlImpl.getFinalStatus() != org.omg.CosTransactions.Status.StatusCommitted) return; } }

Target:
public final void commit (boolean report_heuristics) throws Unavailable, HeuristicMixed, HeuristicHazard, SystemException { try { if (_controlImpl != null) _controlImpl.getImplHandle().commit(report_heuristics); else { Terminator t = null; try { t = _control.get_terminator(); } catch (SystemException e) { throw new Unavailable(); } catch (final NullPointerException ex) { throw new Unavailable(); } if (t != null) t.commit(report_heuristics); else throw new Unavailable(); } } catch (NullPointerException ex) { if (_controlImpl.getFinalStatus() != org.omg.CosTransactions.Status.StatusCommitted) throw new TRANSACTION_ROLLEDBACK(); } }
Source:
public RowIndexEntry append(UnfilteredRowIterator partition) { DecoratedKey key = partition.partitionKey(); if (preemptiveOpenInterval != Long.MAX_VALUE) maybeReopenEarly(key); RowIndexEntry index = writer.append(partition); if (DatabaseDescriptor.getInvalidateKeyCacheOnCompaction()) { if (!transaction.isOffline() && index != null) { for (SSTableReader reader : transaction.originals()) { if (reader.getCachedPosition(key, false) != null) { cachedKeys.put(key, index); break; } } } } return index; }

Target:
public RowIndexEntry append(UnfilteredRowIterator partition) { DecoratedKey key = partition.partitionKey(); maybeReopenEarly(key); RowIndexEntry index = writer.append(partition); if (DatabaseDescriptor.shouldMigrateKeycacheOnCompaction()) { if (!transaction.isOffline() && index != null) { for (SSTableReader reader : transaction.originals()) { if (reader.getCachedPosition(key, false) != null) { cachedKeys.put(key, index); break; } } } } return index; }
Source:
public void testRemoveScopedRole() { RoleRepresentation roleRep = createRealmRole("foo-role"); ClientScopeRepresentation templateRep = new ClientScopeRepresentation(); templateRep.setName("bar-template"); String templateId = createClientScope(templateRep); clientScopes().get(templateId).getScopeMappings().realmLevel().add(Collections.singletonList(roleRep)); assertAdminEvents.assertEvent(getRealmId(), OperationType.CREATE, AdminEventPaths.clientScopeRoleMappingsRealmLevelPath(templateId), Collections.singletonList(roleRep), ResourceType.REALM_SCOPE_MAPPING); List<RoleRepresentation> roleReps = clientScopes().get(templateId).getScopeMappings().realmLevel().listAll(); Assert.assertEquals(1, roleReps.size()); Assert.assertEquals("foo-role", roleReps.get(0).getName()); testRealmResource().roles().deleteRole("foo-role"); assertAdminEvents.assertEvent(getRealmId(), OperationType.DELETE, AdminEventPaths.roleResourcePath("foo-role"), ResourceType.REALM_ROLE); roleReps = clientScopes().get(templateId).getScopeMappings().realmLevel().listAll(); Assert.assertEquals(0, roleReps.size()); removeClientScope(templateId); }

Target:
public void testRemoveScopedRole() { RoleRepresentation roleRep = createRealmRole("foo-role"); ClientScopeRepresentation scopeRep = new ClientScopeRepresentation(); scopeRep.setName("bar-scope"); String scopeId = createClientScope(scopeRep); clientScopes().get(scopeId).getScopeMappings().realmLevel().add(Collections.singletonList(roleRep)); assertAdminEvents.assertEvent(getRealmId(), OperationType.CREATE, AdminEventPaths.clientScopeRoleMappingsRealmLevelPath(scopeId), Collections.singletonList(roleRep), ResourceType.REALM_SCOPE_MAPPING); List<RoleRepresentation> roleReps = clientScopes().get(scopeId).getScopeMappings().realmLevel().listAll(); Assert.assertEquals(1, roleReps.size()); Assert.assertEquals("foo-role", roleReps.get(0).getName()); testRealmResource().roles().deleteRole("foo-role"); assertAdminEvents.assertEvent(getRealmId(), OperationType.DELETE, AdminEventPaths.roleResourcePath("foo-role"), ResourceType.REALM_ROLE); roleReps = clientScopes().get(scopeId).getScopeMappings().realmLevel().listAll(); Assert.assertEquals(0, roleReps.size()); removeClientScope(scopeId); }
Source:
public boolean install(Resource r, ResourceLocation location, Reference ref, ResourceTable table, AndroidCommCarePlatform instance, boolean upgrade) throws UnresolvedResourceException, UnfullfilledRequirementsException { super.install(r, location, ref, table, instance, upgrade); try { Reference local = ReferenceManager._().DeriveReference(localLocation); ProfileParser parser = new ProfileParser(local.getStream(), instance, table, r.getRecordGuid(), upgrade ? Resource.RESOURCE_STATUS_UNINITIALIZED : Resource.RESOURCE_STATUS_UNINITIALIZED, false); Profile p = parser.parse(); instance.setProfile(p); if(!upgrade) { initProperties(p); String newAppId = p.getUniqueId(); ArrayList<ApplicationRecord> installedApps = CommCareApplication._(). getInstalledAppRecords(); for (ApplicationRecord record : installedApps) { if (record.getUniqueId().equals(newAppId)) { throw new UnfullfilledRequirementsException( "The app you are trying to install already exists on this device", CommCareElementParser.SEVERITY_PROMPT, true); } } } table.commit(r, upgrade ? Resource.RESOURCE_STATUS_UPGRADE : Resource.RESOURCE_STATUS_INSTALLED, p.getVersion()); return true; } catch (InvalidReferenceException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (InvalidStructureException e) { throw new UnresolvedResourceException(r, "Invalid content in the Profile Definition: " + e.getMessage(), true); } catch (XmlPullParserException e) { e.printStackTrace(); } return false; }

Target:
public boolean install(Resource r, ResourceLocation location, Reference ref, ResourceTable table, AndroidCommCarePlatform instance, boolean upgrade) throws UnresolvedResourceException, UnfullfilledRequirementsException { super.install(r, location, ref, table, instance, upgrade); try { Reference local = ReferenceManager._().DeriveReference(localLocation); ProfileParser parser = new ProfileParser(local.getStream(), instance, table, r.getRecordGuid(), upgrade ? Resource.RESOURCE_STATUS_UNINITIALIZED : Resource.RESOURCE_STATUS_UNINITIALIZED, false); Profile p = parser.parse(); if(!upgrade) { initProperties(p); checkDuplicate(p); } table.commit(r, upgrade ? Resource.RESOURCE_STATUS_UPGRADE : Resource.RESOURCE_STATUS_INSTALLED, p.getVersion()); return true; } catch (InvalidReferenceException e) { e.printStackTrace(); } catch (IOException e) { e.printStackTrace(); } catch (InvalidStructureException e) { throw new UnresolvedResourceException(r, "Invalid content in the Profile Definition: " + e.getMessage(), true); } catch (XmlPullParserException e) { e.printStackTrace(); } return false; }
Source:
public void getTransferRefunds() throws Exception { Transfer transfer = this.getNewTransfer(); Refund firstRefund = this.getNewRefundForTransfer(transfer); Refund secondRefund = this.getNewRefundForTransfer(transfer); List<Refund> refunds = this.getApi().getTransferApi().getRefunds(transfer.getId()); assertNotNull("Refunds came back null", refunds); assertTrue("Refunds size is not correct", refunds.size() == 2); }

Target:
public void getTransferRefunds() throws Exception { Transfer transfer = this.getNewTransfer(); Refund firstRefund = this.getNewRefundForTransfer(transfer); Refund secondRefund = this.getNewRefundForTransfer(transfer); Pagination pagination = new Pagination(1, 2); List<Refund> refunds = this.getApi().getTransferApi().getRefunds(transfer.getId(), pagination, null); assertNotNull("Refunds came back null", refunds); assertTrue("Refunds size is not correct", refunds.size() == 2); }
Source:
public void handle(final HttpURLConnection connection) { Assert.requireNonNull(connection, "connection"); try { clientCookieHandler.updateCookiesFromResponse(connection); } catch (URISyntaxException e) { throw new DolphinRuntimeException("Can not readResponseContent cookies from response", e); } }

Target:
public void handle(final HttpURLConnection connection) { Assert.requireNonNull(connection, "connection"); try { clientCookieHandler.updateCookiesFromResponse(connection); } catch (final URISyntaxException e) { throw new DolphinRuntimeException("Can not read cookies from response", e); } }
Source:
private long countMapWithAtleastOneIndex(Node node) { return maps.stream().filter(distributedObject -> !(node.hazelcastInstance.getMap(distributedObject.getName()).isEmpty())).count(); }

Target:
private long countMapWithAtleastOneIndex(Node node) { return maps.stream().filter(distributedObject -> { MapConfig config = node.getConfig().getMapConfig(distributedObject.getName()); if (config != null) { return !config.getIndexConfigs().isEmpty(); } return false; }).count(); }
Source:
public void visitMethod(MethodTree tree) { super.visitMethod(tree); Stream<Type> types; if("<init>".equals(tree.symbol().name())) { types = tree.symbol().parameterTypes().stream(); } else { types = Stream.concat(Stream.of(tree.symbol().returnType().type()), tree.symbol().parameterTypes().stream()); } if (tree.block() != null && types.noneMatch(Type::isUnknown)) { CFG cfg = CFG.build(tree); serializeUCFG(tree, cfg); } }

Target:
public void visitMethod(MethodTree tree) { super.visitMethod(tree); List<Type> types = new ArrayList<>(tree.symbol().parameterTypes()); if (!tree.is(CONSTRUCTOR)) { types.add(tree.symbol().returnType().type()); } if (tree.block() != null && types.stream().noneMatch(Type::isUnknown)) { CFG cfg = CFG.build(tree); serializeUCFG(tree, cfg); } }