auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
Class loadClass(String className, boolean resolve) throws ClassNotFoundException { boolean isRS = Thread.currentThread().getName().contains("DRDAConnThread"); JarLoader jl = null; boolean unlockLoader = false; try { unlockLoader = lockClassLoader(ShExQual.SH); synchronized (this) { if (needReload || !isRS) { reload(); } Class clazz = checkLoaded(className, resolve); if (clazz != null) return clazz; for (String RESTRICTED_PACKAGE : RESTRICTED_PACKAGES) { if (className.startsWith(RESTRICTED_PACKAGE)) throw new ClassNotFoundException(className); } String jvmClassName = className.replace('.', '/') + ".class"; if (!initDone) initLoaders(); for (JarLoader aJarList1 : jarList) { jl = aJarList1; Class c = jl.loadClassData(className, jvmClassName, resolve); if (c != null) { if (vs != null) vs.println(MessageService.getTextMessage(MessageId.CM_CLASS_LOAD, className, jl.getJarName())); return c; } } } return null; } catch (StandardException se) { throw new ClassNotFoundException(MessageService.getTextMessage(MessageId.CM_CLASS_LOAD_EXCEPTION, className, jl == null ? null : jl.getJarName(), se)); } finally { if (unlockLoader) { lf.unlock(compat, this, classLoaderLock, ShExQual.SH); } } }

Target:
Class loadClass(String className, boolean resolve) throws ClassNotFoundException { JarLoader jl = null; boolean unlockLoader = false; try { unlockLoader = lockClassLoader(ShExQual.SH); synchronized (this) { if (needReload || !isHBaseJVM) { reload(); } Class clazz = checkLoaded(className, resolve); if (clazz != null) return clazz; for (String RESTRICTED_PACKAGE : RESTRICTED_PACKAGES) { if (className.startsWith(RESTRICTED_PACKAGE)) throw new ClassNotFoundException(className); } String jvmClassName = className.replace('.', '/') + ".class"; if (!initDone) initLoaders(); for (JarLoader aJarList1 : jarList) { jl = aJarList1; Class c = jl.loadClassData(className, jvmClassName, resolve); if (c != null) { if (vs != null) vs.println(MessageService.getTextMessage(MessageId.CM_CLASS_LOAD, className, jl.getJarName())); return c; } } } return null; } catch (StandardException se) { throw new ClassNotFoundException(MessageService.getTextMessage(MessageId.CM_CLASS_LOAD_EXCEPTION, className, jl == null ? null : jl.getJarName(), se)); } finally { if (unlockLoader) { lf.unlock(compat, this, classLoaderLock, ShExQual.SH); } } }
Source:
public File createBadEmailReport(List<PDPBadEmailRecord> badEmailRecords) { LOG.info("createBadEmailReport, there are " + badEmailRecords.size() + " bad email records to report"); initializeErrorReport(); printErrorReportDetails(badEmailRecords); reportWriterService.destroy(); return reportWriterService.getReportFile(); }

Target:
public File createBadEmailReport(List<PDPBadEmailRecord> badEmailRecords) { LOG.info("createBadEmailReport, there are " + badEmailRecords.size() + " bad email addresses to report"); initializeErrorReport(); printErrorReportDetails(badEmailRecords); reportWriterService.destroy(); return reportWriterService.getReportFile(); }
Source:
public void onNewView(Set<Address> members) { try { boolean isDone = false; T result = null; synchronized (responseCollector) { if (missingResponses <= 0) { return; } for (int i = 0; i < targets.length; i++) { Address target = targets[i]; if (target != null && !members.contains(target)) { targets[i] = null; missingResponses--; if (trace) log.tracef("Missing target %s for request %d", target, requestId); result = responseCollector.addResponse(target, CacheNotFoundResponse.INSTANCE); if (result != null) { isDone = true; break; } } } if (!isDone && missingResponses <= 0) { result = responseCollector.finish(); isDone = true; } } if (isDone) { complete(result); } } catch (Throwable t) { completeExceptionally(t); } }

Target:
public void onNewView(Set<Address> members) { try { boolean isDone = false; T result = null; synchronized (responseCollector) { if (missingResponses <= 0) { return; } for (int i = 0; i < targets.length; i++) { Address target = targets[i]; if (target != null && !members.contains(target)) { targets[i] = null; missingResponses--; if (trace) log.tracef("Target %s of request %d left the cluster view", target, requestId); result = responseCollector.addResponse(target, CacheNotFoundResponse.INSTANCE); if (result != null) { isDone = true; break; } } } if (!isDone && missingResponses <= 0) { result = responseCollector.finish(); isDone = true; } } if (isDone) { complete(result); } } catch (Throwable t) { completeExceptionally(t); } }
Source:
public Map<String, Object> getSchedulerPropertiesFromSessionId(@HeaderParam("sessionid") final String sessionId) throws NotConnectedRestException, PermissionRestException { SchedulerProxyUserInterface scheduler = checkAccess(sessionId, "properties"); Map<String, Object> schedulerProperties = null; try { schedulerProperties = scheduler.getSchedulerProperties(); } catch (NotConnectedException e) { logger.warn("Attempt to retrieve scheduler properties but failed because connection exception", e); return null; } catch (PermissionException e) { logger.warn("Attempt to retrieve scheduler properties but failed because permission exception", e); return null; } return schedulerProperties; }

Target:
public Map<String, Object> getSchedulerPropertiesFromSessionId(@HeaderParam("sessionid") final String sessionId) throws NotConnectedRestException, PermissionRestException { SchedulerProxyUserInterface scheduler = checkAccess(sessionId, "properties"); Map<String, Object> schedulerProperties = new HashMap<String, Object>(); try { schedulerProperties = scheduler.getSchedulerProperties(); } catch (NotConnectedException e) { logger.warn("Attempt to retrieve scheduler properties but failed because connection exception", e); throw new PermissionRestException(e); } catch (PermissionException e) { logger.warn("Attempt to retrieve scheduler properties but failed because permission exception", e); throw new NotConnectedRestException(e); } return schedulerProperties; }
Source:
public void spawnParticles(ParticleEffect particleEffect, Vector3d position, int radius) { checkNotNull(particleEffect, "The particle effect cannot be null!"); checkNotNull(position, "The position cannot be null"); checkArgument(radius > 0, "The radius has to be greater then zero!"); List<Packet> packets = SpongeParticleHelper.toPackets((SpongeParticleEffect) particleEffect, position); if (!packets.isEmpty()) { double dx = this.posX - position.getX(); double dy = this.posY - position.getY(); double dz = this.posZ - position.getZ(); if (dx * dx + dy * dy + dz * dz < radius * radius) { packets.forEach(this.playerNetServerHandler::sendPacket); } } }

Target:
public void spawnParticles(ParticleEffect particleEffect, Vector3d position, int radius) { checkNotNull(particleEffect, "The particle effect cannot be null!"); checkNotNull(position, "The position cannot be null"); checkArgument(radius > 0, "The radius has to be greater then zero!"); List<Packet> packets = SpongeParticleHelper.toPackets((SpongeParticleEffect) particleEffect, position); if (!packets.isEmpty()) { double dx = this.posX - position.getX(); double dy = this.posY - position.getY(); double dz = this.posZ - position.getZ(); if (dx * dx + dy * dy + dz * dz < radius * radius) { for (Packet packet : packets) { this.playerNetServerHandler.sendPacket(packet); } } } }
Source:
public StorageModel(StorageModelBehavior behavior) { this.behavior = behavior; this.behavior.setModel(this); Frontend.getQueryStartedEvent().addListener(this); Frontend.getQueryCompleteEvent().addListener(this); Frontend.SubscribeAdditonal(new VdcQueryType[] { VdcQueryType.Search, VdcQueryType.GetConfigurationValue, VdcQueryType.GetStoragePoolsByStorageDomainId, VdcQueryType.GetStorageDomainsByStoragePoolId, VdcQueryType.GetLunsByVgId, VdcQueryType.GetAllVdsByStoragePool, VdcQueryType.DiscoverSendTargets, VdcQueryType.GetDeviceList, VdcQueryType.GetExistingStorageDomainList }); setName(new EntityModel()); setDescription(new EntityModel()); setDataCenter(new ListModel()); getDataCenter().getSelectedItemChangedEvent().addListener(this); setHost(new ListModel()); getHost().getSelectedItemChangedEvent().addListener(this); setFormat(new ListModel()); setAvailableStorageItems(new ListModel()); getAvailableStorageItems().getSelectedItemChangedEvent().addListener(this); AsyncDataProvider.GetLocalFSPath(new AsyncQuery(this, new INewAsyncCallback() { @Override public void OnSuccess(Object target, Object returnValue) { StorageModel storageModel = (StorageModel) target; storageModel.localFSPath = (String) returnValue; } }, getHash())); }

Target:
public StorageModel(StorageModelBehavior behavior) { this.behavior = behavior; this.behavior.setModel(this); Frontend.getQueryStartedEvent().addListener(this); Frontend.getQueryCompleteEvent().addListener(this); Frontend.subscribeAdditionalQueries(new VdcQueryType[] { VdcQueryType.Search, VdcQueryType.GetConfigurationValue, VdcQueryType.GetStoragePoolsByStorageDomainId, VdcQueryType.GetStorageDomainsByStoragePoolId, VdcQueryType.GetLunsByVgId, VdcQueryType.GetAllVdsByStoragePool, VdcQueryType.DiscoverSendTargets, VdcQueryType.GetDeviceList, VdcQueryType.GetExistingStorageDomainList }); setName(new EntityModel()); setDescription(new EntityModel()); setDataCenter(new ListModel()); getDataCenter().getSelectedItemChangedEvent().addListener(this); setHost(new ListModel()); getHost().getSelectedItemChangedEvent().addListener(this); setFormat(new ListModel()); setAvailableStorageItems(new ListModel()); getAvailableStorageItems().getSelectedItemChangedEvent().addListener(this); AsyncDataProvider.GetLocalFSPath(new AsyncQuery(this, new INewAsyncCallback() { @Override public void OnSuccess(Object target, Object returnValue) { StorageModel storageModel = (StorageModel) target; storageModel.localFSPath = (String) returnValue; } }, getHash())); }
Source:
public boolean handleNetworkException(VDSNetworkException ex, VDS vds) { if (vds.getstatus() != VDSStatus.Down) { if (mUnrespondedAttempts.get() < Config.<Integer> GetValue(ConfigValues.VDSAttemptsToResetCount) || lastUpdate + (1000 * Config.<Integer> GetValue(ConfigValues.TimeoutToResetVdsInSeconds)) > System.currentTimeMillis()) { boolean result = false; if (vds.getstatus() != VDSStatus.Connecting && vds.getstatus() != VDSStatus.PreparingForMaintenance && vds.getstatus() != VDSStatus.NonResponsive) { setStatus(VDSStatus.Connecting, vds); result = true; } mUnrespondedAttempts.incrementAndGet(); return result; } if (vds.getstatus() == VDSStatus.NonResponsive || vds.getstatus() == VDSStatus.Maintenance) { setStatus(VDSStatus.NonResponsive, vds); return true; } setStatus(VDSStatus.NonResponsive, vds); log.errorFormat( "VDS::handleNetworkException Server failed to respond, vds_id = {0}, vds_name = {1}, error = {2}", vds.getId(), vds.getvds_name(), ex.getMessage()); AuditLogableBase logable = new AuditLogableBase(vds.getId()); AuditLogDirector.log(logable, AuditLogType.VDS_FAILURE); if (ResourceManager.getInstance().getEventListener() != null) { ResourceManager.getInstance().getEventListener().vdsNotResponding(vds); } } return true; }

Target:
public boolean handleNetworkException(VDSNetworkException ex, VDS vds) { if (vds.getstatus() != VDSStatus.Down) { if (mUnrespondedAttempts.get() < Config.<Integer> GetValue(ConfigValues.VDSAttemptsToResetCount) || lastUpdate + (TimeUnit.SECONDS.toMillis(Config.<Integer> GetValue(ConfigValues.TimeoutToResetVdsInSeconds))) > System.currentTimeMillis()) { boolean result = false; if (vds.getstatus() != VDSStatus.Connecting && vds.getstatus() != VDSStatus.PreparingForMaintenance && vds.getstatus() != VDSStatus.NonResponsive) { setStatus(VDSStatus.Connecting, vds); result = true; } mUnrespondedAttempts.incrementAndGet(); return result; } if (vds.getstatus() == VDSStatus.NonResponsive || vds.getstatus() == VDSStatus.Maintenance) { setStatus(VDSStatus.NonResponsive, vds); return true; } setStatus(VDSStatus.NonResponsive, vds); log.errorFormat( "VDS::handleNetworkException Server failed to respond, vds_id = {0}, vds_name = {1}, error = {2}", vds.getId(), vds.getvds_name(), ex.getMessage()); AuditLogableBase logable = new AuditLogableBase(vds.getId()); AuditLogDirector.log(logable, AuditLogType.VDS_FAILURE); if (ResourceManager.getInstance().getEventListener() != null) { ResourceManager.getInstance().getEventListener().vdsNotResponding(vds); } } return true; }
Source:
public static Drawable getDrawable(Context context, String activityName) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); String currentIconPack = prefs.getString("icons-pack", "default"); if (!("default".equals(currentIconPack) || "squircle".equals(currentIconPack) || "square".equals(currentIconPack) || "circle".equals(currentIconPack))) { return null; } PackageManager pm = context.getPackageManager(); try { ComponentName cn = new ComponentName(GOOGLE_CALENDAR, activityName); Bundle metaData = pm.getActivityInfo(cn, PackageManager.GET_META_DATA | PackageManager.GET_UNINSTALLED_PACKAGES).metaData; Resources resourcesForApplication = pm.getResourcesForApplication(GOOGLE_CALENDAR); int dayResId = getDayResId(metaData, resourcesForApplication); if (dayResId != 0) { Drawable icon = resourcesForApplication.getDrawable(dayResId); if("default".equals(currentIconPack)){ return icon; } else { return DrawableUtils.handleAdaptiveIcons(context, icon); } } } catch (PackageManager.NameNotFoundException ignored) { } return null; }

Target:
public static Drawable getDrawable(Context context, String activityName) { SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); String currentIconPack = prefs.getString("icons-pack", "default"); if (!("default".equals(currentIconPack) || DrawableUtils.isIconsPackAdaptive(currentIconPack))) { return null; } PackageManager pm = context.getPackageManager(); try { ComponentName cn = new ComponentName(GOOGLE_CALENDAR, activityName); Bundle metaData = pm.getActivityInfo(cn, PackageManager.GET_META_DATA | PackageManager.GET_UNINSTALLED_PACKAGES).metaData; Resources resourcesForApplication = pm.getResourcesForApplication(GOOGLE_CALENDAR); int dayResId = getDayResId(metaData, resourcesForApplication); if (dayResId != 0) { Drawable icon = resourcesForApplication.getDrawable(dayResId); if("default".equals(currentIconPack)){ return icon; } else { return DrawableUtils.handleAdaptiveIcons(context, icon); } } } catch (PackageManager.NameNotFoundException ignored) { } return null; }
Source:
private OsiamConnector(Builder builder) { String clientId = builder.clientId; String clientSecret = builder.clientSecret; String clientRedirectUri = builder.clientRedirectUri; String authServiceEndpoint = authServiceEndpoint(builder.authServiceEndpoint, builder.combinedEndpoint); if (!Strings.isNullOrEmpty(authServiceEndpoint)) { AuthService.Builder authServiceBuilder = new AuthService.Builder(authServiceEndpoint); if (clientId != null) { authServiceBuilder = authServiceBuilder.setClientId(clientId); } if (clientSecret != null) { authServiceBuilder = authServiceBuilder.setClientSecret(clientSecret); } if (clientRedirectUri != null) { authServiceBuilder = authServiceBuilder.setClientRedirectUri(clientRedirectUri); } authService = authServiceBuilder.build(); } String resourceServiceEndpoint = resourceServiceEndpoint(builder.resourceServiceEndpoint, builder.combinedEndpoint); if (!Strings.isNullOrEmpty(resourceServiceEndpoint)) { userService = new OsiamUserService.Builder(resourceServiceEndpoint).build(); groupService = new OsiamGroupService.Builder(resourceServiceEndpoint).build(); } }

Target:
private OsiamConnector(Builder builder) { String authServiceEndpoint = authServiceEndpoint(builder.authServiceEndpoint, builder.combinedEndpoint); if (!Strings.isNullOrEmpty(authServiceEndpoint)) { AuthService.Builder authServiceBuilder = new AuthService.Builder(authServiceEndpoint); if (builder.clientId != null) { authServiceBuilder = authServiceBuilder.setClientId(builder.clientId); } if (builder.clientSecret != null) { authServiceBuilder = authServiceBuilder.setClientSecret(builder.clientSecret); } if (builder.clientRedirectUri != null) { authServiceBuilder = authServiceBuilder.setClientRedirectUri(builder.clientRedirectUri); } authService = authServiceBuilder.build(); } String resourceServiceEndpoint = resourceServiceEndpoint(builder.resourceServiceEndpoint, builder.combinedEndpoint); if (!Strings.isNullOrEmpty(resourceServiceEndpoint)) { userService = new OsiamUserService.Builder(resourceServiceEndpoint).build(); groupService = new OsiamGroupService.Builder(resourceServiceEndpoint).build(); } }
Source:
public int run(String[] arg0) throws Exception { final int port = getConf().getInt(TRACE_SERVER_HTTP_PORT_KEY, DEFAULT_HTTP_PORT); BasicConfigurator.configure(); final String home = getConf().get(TRACE_SERVER_HTTP_JETTY_HOME_KEY, DEFAULT_HTTP_HOME); String webappDirLocation = DEFAULT_WEBAPP_DIR_LOCATION; Server server = new Server(port); WebAppContext root = new WebAppContext(); URL webAppDir = Thread.currentThread().getContextClassLoader().getResource(webappDirLocation); if (webAppDir == null) { throw new RuntimeException(String.format("No %s directory was found into the JAR file", webappDirLocation)); } root.setContextPath(home); root.setDescriptor(webappDirLocation + "/WEB-INF/web.xml"); root.setResourceBase(webAppDir.toURI().toString()); root.setParentLoaderPriority(true); server.setHandler(root); server.start(); server.join(); return 0; }

Target:
public int run(String[] arg0) throws Exception { final int port = getConf().getInt(TRACE_SERVER_HTTP_PORT_KEY, DEFAULT_HTTP_PORT); BasicConfigurator.configure(); final String home = getConf().get(TRACE_SERVER_HTTP_JETTY_HOME_KEY, DEFAULT_HTTP_HOME); Server server = new Server(port); WebAppContext root = new WebAppContext(); URL webAppDir = Thread.currentThread().getContextClassLoader().getResource(DEFAULT_WEBAPP_DIR_LOCATION); if (webAppDir == null) { throw new RuntimeException(String.format("No %s directory was found into the JAR file", DEFAULT_WEBAPP_DIR_LOCATION)); } root.setContextPath(home); root.setDescriptor(DEFAULT_WEBAPP_DIR_LOCATION + "/WEB-INF/web.xml"); root.setResourceBase(webAppDir.toURI().toString()); root.setParentLoaderPriority(true); server.setHandler(root); server.start(); server.join(); return 0; }
Source:
public boolean isValid(List<VdsNetworkInterface> value, ConstraintValidatorContext context) { Collection<String> staticIps = new HashSet<String>(); for (VdsNetworkInterface networkInterface : value) { String address = networkInterface.getAddress(); if (networkInterface.getBootProtocol() == NetworkBootProtocol.StaticIp && address != null && !"".equals(address)) { if (staticIps.contains(networkInterface.getAddress())) { return false; } else { staticIps.add(networkInterface.getAddress()); } } } return true; }

Target:
public boolean isValid(List<VdsNetworkInterface> value, ConstraintValidatorContext context) { Collection<String> staticIps = new HashSet<String>(); for (VdsNetworkInterface networkInterface : value) { String address = networkInterface.getAddress(); if (networkInterface.getBootProtocol() == NetworkBootProtocol.StaticIp && address != null && !address.isEmpty()) { if (staticIps.contains(networkInterface.getAddress())) { return false; } else { staticIps.add(networkInterface.getAddress()); } } } return true; }
Source:
static File gunzip(File zipFile) throws Exception { File outputFile = new File(stripGzSuffix(zipFile.getAbsolutePath())); byte[] buffer = new byte[1024]; try { GZIPInputStream gzis = new GZIPInputStream(new FileInputStream(zipFile)); FileOutputStream out = new FileOutputStream(outputFile); int len; while ((len = gzis.read(buffer)) > 0) { out.write(buffer, 0, len); } gzis.close(); out.close(); return outputFile; } catch (IOException e) { LOG.error("fail to gunzip file: " + zipFile, e); throw new Exception("fail to gunzip file" + zipFile); } }

Target:
static File gunzip(File zipFile) { File outputFile = new File(stripGzSuffix(zipFile.getAbsolutePath())); byte[] buffer = new byte[1024]; try { GZIPInputStream gzis = new GZIPInputStream(new FileInputStream(zipFile)); FileOutputStream out = new FileOutputStream(outputFile); int len; while ((len = gzis.read(buffer)) > 0) { out.write(buffer, 0, len); } gzis.close(); out.close(); return outputFile; } catch (IOException e) { LOG.error("fail to gunzip file: " + zipFile, e); } return null; }
Source:
public static void createGlobalInstance(Context c) { if (sInstance != null) { return; } sInstance = new ClientPrefs(c); }

Target:
public static synchronized void createGlobalInstance(Context c) { if (sInstance != null) { return; } sInstance = new ClientPrefs(c); }
Source:
public void persists_new_components_as_private_if_root_does_not_exist_yet_out_of_functional_transaction() { treeRootHolder.setRoot( builder(PROJECT, 1).setUuid("ABCD").setKey(PROJECT_KEY) .setName("Project") .addChildren( builder(Component.Type.MODULE, 2).setUuid("BCDE").setKey("MODULE") .setName("Module") .addChildren( builder(Component.Type.DIRECTORY, 3).setUuid("DEFG").setKey("DIR") .setPath("Directory") .addChildren( builder(FILE, 4).setUuid("CDEF").setKey("FILE") .setPath("file") .build()) .build()) .build()) .build()); underTest.execute(); Stream.of("ABCD", "BCDE", "BCDE", "BCDE") .forEach(uuid -> assertThat(dbClient.componentDao().selectByUuid(dbTester.getSession(), uuid).get().isPrivate()).isFalse()); }

Target:
public void persists_new_components_as_private_if_root_does_not_exist_yet_out_of_functional_transaction() { treeRootHolder.setRoot(createSampleProjectComponentTree("ABCD", PROJECT_KEY)); underTest.execute(); Stream.of("ABCD", "BCDE", "DEFG", "CDEF") .forEach(uuid -> assertThat(dbClient.componentDao().selectByUuid(dbTester.getSession(), uuid).get().isPrivate()).isFalse()); }
Source:
protected void eventHandle(@NonNull ITmfEvent event) { ITmfStateSystemBuilder ss = getStateSystemBuilder(); if(ss == null) { return; } String phase = event.getContent().getFieldValue(String.class, ITraceEventConstants.PHASE); long t = event.getTimestamp().toNanos(); if(Objects.equals(phase, "N")) { int quark = ss.getQuarkAbsoluteAndAdd(event.getContent().getFieldValue(String.class, ITraceEventConstants.NAME), event.getContent().getFieldValue(String.class, ITraceEventConstants.ID) ); ss.modifyAttribute(t, "", quark); } if(Objects.equals(phase, "D")) { int quark = ss.getQuarkAbsoluteAndAdd(event.getContent().getFieldValue(String.class, ITraceEventConstants.NAME), event.getContent().getFieldValue(String.class, ITraceEventConstants.ID) ); ss.modifyAttribute(t, TmfStateValue.nullValue(), quark); } if(Objects.equals(phase, "O")) { int quark = ss.getQuarkAbsoluteAndAdd(event.getContent().getFieldValue(String.class, ITraceEventConstants.NAME), event.getContent().getFieldValue(String.class, ITraceEventConstants.ID) ); ss.modifyAttribute(t, String.valueOf(TraceEventAspects.ARGS_ASPECT.resolve(event)), quark); } }

Target:
protected void eventHandle(@NonNull ITmfEvent event) { ITmfStateSystemBuilder ss = getStateSystemBuilder(); if (ss == null) { return; } String phase = event.getContent().getFieldValue(String.class, ITraceEventConstants.PHASE); long t = event.getTimestamp().toNanos(); if (Objects.equals(phase, TraceEventPhases.objectCreated())) { int quark = ss.getQuarkAbsoluteAndAdd(event.getContent().getFieldValue(String.class, ITraceEventConstants.NAME), event.getContent().getFieldValue(String.class, ITraceEventConstants.ID)); ss.modifyAttribute(t, "", quark); } if (Objects.equals(phase, TraceEventPhases.objectSnapshot())) { int quark = ss.getQuarkAbsoluteAndAdd(event.getContent().getFieldValue(String.class, ITraceEventConstants.NAME), event.getContent().getFieldValue(String.class, ITraceEventConstants.ID)); ss.modifyAttribute(t, TmfStateValue.nullValue(), quark); } if (Objects.equals(phase, TraceEventPhases.objectDestroyed())) { int quark = ss.getQuarkAbsoluteAndAdd(event.getContent().getFieldValue(String.class, ITraceEventConstants.NAME), event.getContent().getFieldValue(String.class, ITraceEventConstants.ID)); ss.modifyAttribute(t, String.valueOf(TraceEventAspects.ARGS_ASPECT.resolve(event)), quark); } }
Source:
public void accept(Event<UpscaleClusterRequest> event) { LOGGER.debug("UpscaleClusterHandler for {}", event.getData().getResourceId()); Instant start = Instant.now(); UpscaleClusterRequest request = event.getData(); UpscaleClusterResult result; try { clusterUpscaleService.installServicesOnNewHosts(request.getResourceId(), request.getHostGroupName()); result = new UpscaleClusterResult(request); } catch (Exception e) { result = new UpscaleClusterResult(e.getMessage(), e, request); } finally { LOGGER.debug("UpscaleClusterHandler for finished in {}ms", event.getData().getResourceId(), Duration.between(start, Instant.now()).toMillis()); } eventBus.notify(result.selector(), new Event<>(event.getHeaders(), result)); }

Target:
public void accept(Event<UpscaleClusterRequest> event) { LOGGER.debug("UpscaleClusterHandler for {}", event.getData().getResourceId()); Instant start = Instant.now(); UpscaleClusterRequest request = event.getData(); UpscaleClusterResult result; try { clusterUpscaleService.installServicesOnNewHosts(request.getResourceId(), request.getHostGroupName(), request.isRepair(), request.isRestartServices()); result = new UpscaleClusterResult(request); } catch (Exception e) { result = new UpscaleClusterResult(e.getMessage(), e, request); } finally { LOGGER.debug("UpscaleClusterHandler for finished in {}ms", event.getData().getResourceId(), Duration.between(start, Instant.now()).toMillis()); } eventBus.notify(result.selector(), new Event<>(event.getHeaders(), result)); }
Source:
private void loadFrontendFilesIntoCore() { Path moduleFolder = FileSystems.getDefault().getPath(modulePath); try { DirectoryStream<Path> stream = Files.newDirectoryStream(moduleFolder, "*.jar"); for (Path f : stream) { File loc = new File(f.toString()); JarFile jarFile = new JarFile(loc); if (hasFrontendFiles(jarFile)) { Path systemTempFolder = FileSystems.getDefault().getPath(System.getProperty("java.io.tmpdir")); Path temporaryFolder = Files.createTempDirectory(systemTempFolder, TEMP_DIR_PREFIX); String temporaryFolderName = Paths.get(temporaryFolder.toUri()).toAbsolutePath().toString(); File tempFolderFile = new File(temporaryFolderName); tempFolderFile.deleteOnExit(); extractFrontEndFiles(loc.getAbsolutePath(), temporaryFolderName); String moduleName = extractModuleName(temporaryFolderName); if (!moduleName.isEmpty()) { FacesContext facesContext = FacesContext.getCurrentInstance(); HttpSession session = (HttpSession) facesContext.getExternalContext().getSession(false); String filePath = session.getServletContext().getRealPath(File.separator + PAGES_FOLDER) + File.separator + moduleName; FileUtils.deleteDirectory(new File(filePath)); String resourceFolder = String.join(File.separator, Arrays.asList(temporaryFolderName, META_INF_FOLDER, RESOURCES_FOLDER)); copyFrontEndFiles(resourceFolder, filePath); FileUtils.deleteDirectory(tempFolderFile); } else { logger.info("No module found in JarFile '" + jarFile.getName() + "'."); } } } } catch (Exception e) { logger.error("Classpath could not be accessed", e.getMessage()); } }

Target:
private void loadFrontendFilesIntoCore() { Path moduleFolder = FileSystems.getDefault().getPath(modulePath); try (DirectoryStream<Path> stream = Files.newDirectoryStream(moduleFolder, "*.jar")) { for (Path f : stream) { File loc = new File(f.toString()); try (JarFile jarFile = new JarFile(loc)) { if (hasFrontendFiles(jarFile)) { Path temporaryFolder = Files.createTempDirectory(SYSTEM_TEMP_FOLDER, TEMP_DIR_PREFIX); File tempDir = new File(Paths.get(temporaryFolder.toUri()).toAbsolutePath().toString()); extractFrontEndFiles(loc.getAbsolutePath(), tempDir); String moduleName = extractModuleName(tempDir); if (!moduleName.isEmpty()) { FacesContext facesContext = FacesContext.getCurrentInstance(); HttpSession session = (HttpSession) facesContext.getExternalContext().getSession(false); String filePath = session.getServletContext().getRealPath(File.separator + PAGES_FOLDER) + File.separator + moduleName; FileUtils.deleteDirectory(new File(filePath)); String resourceFolder = String.join(File.separator, Arrays.asList(tempDir.getAbsolutePath(), META_INF_FOLDER, RESOURCES_FOLDER)); copyFrontEndFiles(resourceFolder, filePath); } else { logger.info("No module found in JarFile '" + jarFile.getName() + "'."); } FileUtils.deleteDirectory(tempDir); } } } } catch (Exception e) { logger.error("Classpath could not be accessed", e.getMessage()); } }
Source:
public List<String> getClasses() { makeFilter(); String testClassDirectoryPath = StringUtils.join(new String[] {targetDir, "target", "test-classes"}, File.separator); scanner.setBasedir(testClassDirectoryPath); scanner.setCaseSensitive(true); scanner.scan(); List<String> ret = new ArrayList<>(); for(String s: scanner.getIncludedFiles()){ ret.add(s.replaceAll("/", ".").replaceAll("\\.class","")); } return ret; }

Target:
public List<String> getClasses() { makeFilter(); final String testClassPath = new PathBuilder().path(targetDir).path("target").path("test-classes").buildFilePath(); scanner.setBasedir(testClassPath); scanner.setCaseSensitive(true); scanner.scan(); List<String> ret = new ArrayList<>(); for(String s: scanner.getIncludedFiles()){ ret.add(s.replaceAll("/", ".").replaceAll("\\.class","")); } return ret; }
Source:
private T findUniqueResult() { if (collection.size() == 1) { return collection.iterator().next(); } return uniqueResult; }

Target:
private T findUniqueResult() { return collection.size() == 1 ? collection.iterator().next() : null; }
Source:
private QueryIterator concreteSubject(Binding binding, Node s, Node score, Node literal, StrMatch match, ExecutionContext execCxt) { if (!s.isURI()) { log.warn("Subject not a URI: " + s) ; return IterLib.noResults(execCxt) ; } String qs = match.getQueryString() ; List<TextHit> x = query(match.getProperty(), match.getQueryString(), -1, execCxt) ; if ( x == null ) return IterLib.noResults(execCxt) ; List<TextHit> r = new LinkedList(); for (TextHit hit : x ) { if (hit.getNode().equals(s)) { r.add(hit); } } return resultsToQueryIterator(binding, s, score, literal, r, execCxt); }

Target:
private QueryIterator concreteSubject(Binding binding, Node s, Node score, Node literal, StrMatch match, ExecutionContext execCxt) { if (!s.isURI()) { log.warn("Subject not a URI: " + s) ; return IterLib.noResults(execCxt) ; } String qs = match.getQueryString() ; List<TextHit> x = query(match.getProperty(), match.getQueryString(), -1, execCxt) ; if ( x == null ) return IterLib.noResults(execCxt) ; List<TextHit> r = x.stream().filter(hit -> hit.getNode().equals(s)).collect(Collectors.toList()); return resultsToQueryIterator(binding, s, score, literal, r, execCxt); }
Source:
public boolean isForeignKey(RelOptTable fromTable, List<Integer> fromColumns, RelOptTable toTable, List<Integer> toColumns) { final JdbcTable jdbcTable = fromTable.unwrap(JdbcTable.class); return withBuilder(jdbcTable.jdbcSchema, (cluster, relOptSchema, jdbcSchema, relBuilder) -> { final RelOptTable.ToRelContext toRelContext = ViewExpanders.simpleContext(cluster); relBuilder.push(fromTable.toRel(toRelContext)) .filter(fromColumns.stream() .map(column -> relBuilder.call(SqlStdOperatorTable.IS_NOT_NULL, relBuilder.field(column))) .collect(Collectors.toList())) .project(relBuilder.fields(fromColumns)) .push(toTable.toRel(toRelContext)) .project(relBuilder.fields(toColumns)) .minus(false, 2) .aggregate(relBuilder.groupKey(), relBuilder.count()); final String sql = toSql(relBuilder.build(), jdbcSchema.dialect); final DataSource dataSource = jdbcTable.jdbcSchema.getDataSource(); try (Connection connection = dataSource.getConnection(); Statement statement = connection.createStatement(); ResultSet resultSet = statement.executeQuery(sql)) { if (!resultSet.next()) { throw new AssertionError(); } return resultSet.getInt(1) == 0; } catch (SQLException e) { throw handle(e, sql); } }); }

Target:
public boolean isForeignKey(RelOptTable fromTable, List<Integer> fromColumns, RelOptTable toTable, List<Integer> toColumns) { final JdbcTable jdbcTable = fromTable.unwrap(JdbcTable.class); return withBuilder(jdbcTable.jdbcSchema, (cluster, relOptSchema, jdbcSchema, relBuilder) -> { final RelOptTable.ToRelContext toRelContext = ViewExpanders.simpleContext(cluster); relBuilder.push(fromTable.toRel(toRelContext)) .filter(fromColumns.stream() .map(column -> relBuilder.call(SqlStdOperatorTable.IS_NOT_NULL, relBuilder.field(column))) .collect(Collectors.toList())) .project(relBuilder.fields(fromColumns)) .push(toTable.toRel(toRelContext)) .project(relBuilder.fields(toColumns)) .minus(false, 2) .aggregate(relBuilder.groupKey(), relBuilder.count()); final String sql = toSql(relBuilder.build(), jdbcSchema.dialect); final DataSource dataSource = jdbcTable.jdbcSchema.getDataSource(); try (Connection connection = dataSource.getConnection(); Statement statement = connection.createStatement(); ResultSet resultSet = statement.executeQuery(sql)) { if (!resultSet.next()) { throw new AssertionError("expected exactly 1 row: " + sql); } final int count = resultSet.getInt(1); if (resultSet.next()) { throw new AssertionError("expected exactly 1 row: " + sql); } return count == 0; } catch (SQLException e) { throw handle(e, sql); } }); }
Source:
public void process(final Exchange exchange) { try { final SMSMessage smsMessage = exchange.getIn().getBody(SMSMessage.class); if (smsMessage == null) { throw new NullPointerException(); } LOG.trace("Validating SMSMessage instance provided: {}", smsMessage.toString()); final Set<ConstraintViolation<SMSMessage>> constraintViolations = getValidator().validate(smsMessage); if (constraintViolations.size() > 0) { final StringBuffer msg = new StringBuffer(); for (final ConstraintViolation<SMSMessage> cv : constraintViolations) { msg.append(String.format("- Invalid value for %s: %s", cv.getPropertyPath().toString(), cv.getMessage())); } throw new InvalidPayloadException(msg.toString()); } LOG.trace("SMSMessage instance is valid: {}", smsMessage.toString()); final CMMessage cmMessage = new CMMessage(smsMessage.getPhoneNumber(), smsMessage.getMessage()); LOG.debug("CMMessage instance build from valid SMSMessage instance"); if (smsMessage.getFrom() == null || smsMessage.getFrom().isEmpty()) { String df = getConfiguration().getDefaultFrom(); cmMessage.setSender(df); LOG.debug("Dynamic sender is set to default dynamic sender: {}", df); } cmMessage.setIdAsString(smsMessage.getId()); cmMessage.setUnicodeAndMultipart(getConfiguration().getDefaultMaxNumberOfParts()); sender.send(cmMessage); log.debug("Request accepted by CM Host: {}", cmMessage.toString()); } catch (final NullPointerException e) { final String m = "Check Message body - Has to be an SMSMessage instance"; log.error(m, e); exchange.setException(new InvalidPayloadException(m)); } catch (final RuntimeException e) { log.error("Message cannot be sent ", e); exchange.setException(e); } }

Target:
public void process(final Exchange exchange) throws Exception { final SMSMessage smsMessage = exchange.getIn().getMandatoryBody(SMSMessage.class); log.trace("Validating SMSMessage instance provided: {}", smsMessage.toString()); final Set<ConstraintViolation<SMSMessage>> constraintViolations = getValidator().validate(smsMessage); if (constraintViolations.size() > 0) { final StringBuffer msg = new StringBuffer(); for (final ConstraintViolation<SMSMessage> cv : constraintViolations) { msg.append(String.format("- Invalid value for %s: %s", cv.getPropertyPath().toString(), cv.getMessage())); } log.debug(msg.toString()); throw new InvalidPayloadRuntimeException(exchange, SMSMessage.class); } log.trace("SMSMessage instance is valid: {}", smsMessage.toString()); final CMMessage cmMessage = new CMMessage(smsMessage.getPhoneNumber(), smsMessage.getMessage()); log.debug("CMMessage instance build from valid SMSMessage instance"); if (smsMessage.getFrom() == null || smsMessage.getFrom().isEmpty()) { String df = getConfiguration().getDefaultFrom(); cmMessage.setSender(df); log.debug("Dynamic sender is set to default dynamic sender: {}", df); } cmMessage.setIdAsString(smsMessage.getId()); cmMessage.setUnicodeAndMultipart(getConfiguration().getDefaultMaxNumberOfParts()); sender.send(cmMessage); log.debug("Request accepted by CM Host: {}", cmMessage.toString()); }
Source:
public void init() { LOG.info("Initializing side input stores."); Map<SystemStreamPartition, String> fileOffsets = getFileOffsets(); LOG.info("File offsets for the task {}: {}", taskName, fileOffsets); initializeStoreDirectories(); }

Target:
public void init() { LOG.info("Initializing side input stores."); initializeStoreDirectories(); }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ConsumerRateInfo that = (ConsumerRateInfo) o; return Objects.equals(consumerId, that.consumerId) && Objects.equals(maxRate, that.maxRate) && Objects.equals(history, that.history); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } ConsumerRateInfo that = (ConsumerRateInfo) o; return Objects.equals(consumerId, that.consumerId); }
Source:
public void addPart(String name, TypedOutput body) { if (name == null) { throw new NullPointerException("Part name must not be null."); } if (body == null) { throw new NullPointerException("Part body must not be null."); } MimePart part = new MimePart(name, body, boundary, mimeParts.isEmpty()); mimeParts.add(part); long size = part.size(); if (size < 0) { length = -1; } else if (length >= 0) { length += size; } }

Target:
public void addPart(String name, TypedOutput body) { if (name == null) { throw new NullPointerException("Part name must not be null."); } if (body == null) { throw new NullPointerException("Part body must not be null."); } MimePart part = new MimePart(name, body, boundary, mimeParts.isEmpty()); mimeParts.add(part); long size = part.size(); if (size == -1) { length = -1; } else if (length != -1) { length += size; } }
Source:
public void testOverriddenAttributesMustMatchInType() { validator.validate( new DummyEntityWithZipCode( "foobar" ) ); fail( "Wrong attribute override in composite constraint. An Exception should have been thrown." ); }

Target:
public void testOverriddenAttributesMustMatchInType() { validator.validate( new DummyEntityWithZipCode( "foobar" ) ); }
Source:
public double similarity(MatrixRow a, MatrixRow b) { int na = a.getNumCols(); int nb = b.getNumCols(); int intersect = 0; int i = 0, j = 0; int ca = a.getColIndex(i); int cb = b.getColIndex(j); if((i != 0 || j != 0)) { while (i < na && j < nb) { if (ca < cb) { i++; ca = a.getColIndex(i); } else if (ca > cb) { j++; cb = b.getColIndex(j); } else { i++; j++; intersect++; ca = a.getColIndex(i); cb = b.getColIndex(j); } } } return SimUtils.googleSimilarity(na, nb, intersect, numPages); }

Target:
public double similarity(MatrixRow a, MatrixRow b) { int na = a.getNumCols(); int nb = b.getNumCols(); int intersect = 0; int i = 0, j = 0; if((na == 0 || nb == 0)) { return 0; } int ca = a.getColIndex(i); int cb = b.getColIndex(j); while (i < na && j < nb) { if (ca < cb) { i++; ca = a.getColIndex(i); } else if (ca > cb) { j++; cb = b.getColIndex(j); } else { i++; j++; intersect++; ca = a.getColIndex(i); cb = b.getColIndex(j); } } return SimUtils.googleSimilarity(na, nb, intersect, numPages); }
Source:
public void seekToUs(long positionUs) { boolean result; lastSeekPositionUs = positionUs; if (isWithinLastChunk(positionUs)) { result = sampleQueue.skipToLastKeyframe(positionUs); } else { result = sampleQueue.skipToKeyframeBefore(positionUs); } boolean seekInsideBuffer = (!isPendingReset()) && (result == true); if (seekInsideBuffer) { while (mediaChunks.size() > 1 && mediaChunks.get(1).getFirstSampleIndex() <= sampleQueue.getReadIndex()) { mediaChunks.removeFirst(); } } else { pendingResetPositionUs = positionUs; loadingFinished = false; mediaChunks.clear(); if (loader.isLoading()) { loader.cancelLoading(); } else { sampleQueue.reset(true); } } }

Target:
public void seekToUs(long positionUs) { boolean result; lastSeekPositionUs = positionUs; if (isWithinLastChunk(positionUs)) { result = sampleQueue.skipToLastKeyframe(positionUs); } else { result = sampleQueue.skipToKeyframeBefore(positionUs); } boolean seekInsideBuffer = !isPendingReset() && sampleQueue.skipToKeyframeBefore(positionUs, isWithinLastChunk(positionUs)); if (seekInsideBuffer) { while (mediaChunks.size() > 1 && mediaChunks.get(1).getFirstSampleIndex() <= sampleQueue.getReadIndex()) { mediaChunks.removeFirst(); } } else { pendingResetPositionUs = positionUs; loadingFinished = false; mediaChunks.clear(); if (loader.isLoading()) { loader.cancelLoading(); } else { sampleQueue.reset(true); } } }
Source:
public boolean addDependency(DynamicPomDependency dep, Path pomPath) { if (dep == null || !isGroupIDValid(dep) || !isArtifactIDValid(dep)) { return false; } boolean result = false; try { boolean internalArtifact = isInternalArtifact(dep); org.uberfire.java.nio.file.Path filePath = Paths.get(pomPath.toURI()); Model model = getPOMModel(filePath); List<Dependency> depsFromPom = model.getDependencies(); Map<String, String> keys = getKeysFromDependencies(depsFromPom); String keyDep = getKeyFromDynamicDependency(dep); if (!keys.containsKey(keyDep)) { Dependency pomDep = getMavenPomDep(dep, internalArtifact, getKieVersionFromPom(dep, depsFromPom)); model.getDependencies().add(pomDep); result = true; } else { for (Dependency modelDep : depsFromPom) { if (modelDep.getGroupId().equals(dep.getGroupID()) && modelDep.getArtifactId().equals(dep.getArtifactID())) { if (internalArtifact) { modelDep.setVersion(getKieVersionFromPom(dep, depsFromPom)); } else { modelDep.setVersion(keys.get(keyDep)); } } } } if (result) { writePOMModelOnFS(filePath, model); } } catch (Exception ex) { logger.error(ex.getMessage(), ex); result = false; } return result; }

Target:
public boolean addDependency(DynamicPomDependency dep, Path pomPath) { if (dep == null || !isGroupIDValid(dep) || !isArtifactIDValid(dep)) { return false; } boolean pomUpdated = false; try { boolean internalArtifact = isInternalArtifact(dep); org.uberfire.java.nio.file.Path filePath = Paths.get(pomPath.toURI()); Model model = getPOMModel(filePath); List<Dependency> depsFromPom = model.getDependencies(); Map<String, String> keys = getKeysFromDependencies(depsFromPom); String keyDep = getKeyFromDynamicDependency(dep); if (!keys.containsKey(keyDep)) { Dependency pomDep = getMavenPomDep(dep, internalArtifact, getKieVersionFromPom(dep, depsFromPom)); model.getDependencies().add(pomDep); pomUpdated = true; } if (pomUpdated) { writePOMModelOnFS(filePath, model); } } catch (Exception ex) { logger.error(ex.getMessage(), ex); pomUpdated = false; } return pomUpdated; }
Source:
private void sawDelete() { if (isPartialCompaction) { switch (deleteHandlingAction) { case LOG_ERROR: try { loggedMsgCache.get(this.getClass().getName(), new Callable<Long>() { @Override public Long call() throws Exception { log.error("Combiner of type " + this.getClass().getSimpleName() + " saw a delete during a partial compaction. This could cause undesired results. See ACCUMULO-2232. Will not log subsequent occurences for at least 1 hour."); return 42L; } }); } catch (ExecutionException e) { throw new RuntimeException(e); } break; case THROW_EXCEPTION: throw new IllegalStateException("Saw a delete during a partial compaction. This could cause undesired results. See ACCUMULO-2232."); case IGNORE: break; case REDUCE_ON_FULL_COMPACTION_ONLY: default: throw new IllegalStateException("Unexpected case occurred in code, please file a bug " + deleteHandlingAction); } } }

Target:
private void sawDelete() { if (isMajorCompaction && !reduceOnFullCompactionOnly) { try { loggedMsgCache.get(this.getClass().getName(), new Callable<Boolean>() { @Override public Boolean call() throws Exception { sawDeleteLog.error("Combiner of type " + this.getClass().getSimpleName() + " saw a delete during a partial compaction. This could cause undesired results. See ACCUMULO-2232. Will not log subsequent occurences for at least 1 hour."); return Boolean.TRUE; } }); } catch (ExecutionException e) { throw new RuntimeException(e); } } }
Source:
public void process(PipelineConfig pipelineConfig) { ParamResolver resolver = new ParamResolver(new ParamSubstitutionHandlerFactory(new ParamsConfig()), fieldCache); resolver.resolve(pipelineConfig); }

Target:
public void process(PipelineConfig pipelineConfig) { resolver.resolve(pipelineConfig); }
Source:
public void actionUpdateAttributeTypes(AttributeType typeNew) { String currentAttribute = attribute; if (model.getInputConfig() != null && model.getInputConfig().getInput() != null) { DataHandle handle = model.getInputConfig().getInput().getHandle(); if (handle != null) { for (int i = 0; i < handle.getNumColumns(); i++) { String attribute = handle.getAttributeName(i); AttributeType type = model.getInputDefinition().getAttributeType(attribute); if (type != typeNew) { for (int k = 0; k < COMBO1_TYPES.length; k++) { if (typeNew == COMBO1_TYPES[k]) { cmbType.select(k); this.attribute = attribute; actionAttributeTypeChanged(); } } } } } } this.attribute = currentAttribute; }

Target:
public void actionUpdateAttributeTypes(AttributeType typeNew) { if (model.getInputConfig() != null && model.getInputConfig().getInput() != null) { DataHandle handle = model.getInputConfig().getInput().getHandle(); if (handle != null) { for (int i = 0; i < handle.getNumColumns(); i++) { String attribute = handle.getAttributeName(i); AttributeType type = model.getInputDefinition().getAttributeType(attribute); if (type != typeNew) { actionAttributeTypeChanged(attribute, typeNew); } } } } }
Source:
void setUp() { MysqlDataSource dataSource = new MysqlDataSource(); dataSource.setUrl(MYSQL_CONTAINER.getJdbcUrl()); dataSource.setUser(MYSQL_CONTAINER.getUsername()); dataSource.setPassword(MYSQL_CONTAINER.getPassword()); try { testSubject = createEngine(dataSource); } catch (Exception e) { throw new TestAbortedException("Ignoring this test, as no valid MySQL instance is configured", e); } }

Target:
void setUp() throws SQLException { MysqlDataSource dataSource = new MysqlDataSource(); dataSource.setUrl(MYSQL_CONTAINER.getJdbcUrl()); dataSource.setUser(MYSQL_CONTAINER.getUsername()); dataSource.setPassword(MYSQL_CONTAINER.getPassword()); testSubject = createEngine(dataSource); }
Source:
public FetchCommand setCheckFetchedObjects(boolean checkFetchedObjects) { this.checkFetchedObjects = checkFetchedObjects; return this; }

Target:
public FetchCommand setCheckFetchedObjects(boolean checkFetchedObjects) { checkCallable(); this.checkFetchedObjects = checkFetchedObjects; return this; }
Source:
public String getSource(LogEntry logentry) { return logentry.getSource().getName(); }

Target:
public String getSource(LogEntry logentry) { return logentry.getSource().getUuid(); }
Source:
public CoupleMbusDeviceByChannelResponseDto(final ChannelElementValuesDto channelElementValues) { super(); this.channelElementValues = channelElementValues; }

Target:
public CoupleMbusDeviceByChannelResponseDto(final ChannelElementValuesDto channelElementValues) { this.channelElementValues = channelElementValues; }
Source:
public void getCodeSystemByShortNameFromAllRepositoreis() { final CodeSystems existingCodeSystem = CodeSystemRequests.prepareSearchCodeSystemsInAllRepositories() .filterById(SNOMEDCT) .build() .execute(Services.context()); assertEquals(existingCodeSystem.getTotal(), 1); assertEquals(SNOMEDCT, Iterables.getOnlyElement(existingCodeSystem.getItems()).getShortName()); final CodeSystems nonExistentCodeSystem = CodeSystemRequests.prepareSearchCodeSystemsInAllRepositories() .filterById("not a valid code system short name") .build() .execute(Services.context()); assertEquals(nonExistentCodeSystem.getTotal(), 0); }

Target:
public void getCodeSystemByShortNameFromAllRepositoreis() { final String shortName = "ShortName"; final String oid = "Oid"; assertCodeSystemCreated(shortName, oid); final CodeSystems existingCodeSystem = CodeSystemRequests.prepareSearchAllCodeSystems() .filterById(shortName) .build() .execute(Services.context()); assertThat(existingCodeSystem.getItems()).hasSize(1); assertThat(existingCodeSystem.getItems().get(0).getShortName()).isEqualTo(shortName); }