auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private boolean fillBufferIfWeHaveExhaustedIt() throws IOException { if ( bufferPos >= bufferEnd ) { boolean first = currentChunk == null; if ( !first ) { currentChunk.close(); if ( bufferPos - seekStartPos >= dataCapacity ) { throw new IllegalStateException( "Tried to read a field larger than buffer size " + dataLength + ". A common cause of this is that a field has an unterminated " + "quote and so will try to seek until the next quote, which ever line it may be on." + " This should not happen if multi-line fields are disabled, given that the fields contains " + "no new-line characters. If you are running a `LOAD CSV query it may also be possible that " + "increasing the buffer size via `dbms.import.csv.buffer_size` could help. " + "This field started at " + sourceDescription() + ":" + lineNumber() ); } } absoluteBufferStartPosition += dataLength; Chunk nextChunk = source.nextChunk( first ? -1 : seekStartPos ); if ( nextChunk.backPosition() == nextChunk.startPosition() + nextChunk.length() ) { return false; } buffer = nextChunk.data(); dataLength = nextChunk.length(); dataCapacity = nextChunk.maxFieldSize(); bufferPos = nextChunk.startPosition(); bufferEnd = bufferPos + dataLength; int shift = seekStartPos - nextChunk.backPosition(); seekStartPos = nextChunk.backPosition(); if ( first ) { lineStartPos = seekStartPos; } else { lineStartPos -= shift; } String sourceDescriptionAfterRead = nextChunk.sourceDescription(); if ( !sourceDescriptionAfterRead.equals( sourceDescription ) ) { lineNumber = 0; sourceDescription = sourceDescriptionAfterRead; } currentChunk = nextChunk; return dataLength > 0; } return true; }

Target:
private boolean fillBufferIfWeHaveExhaustedIt() throws IOException { if ( bufferPos >= bufferEnd ) { boolean first = currentChunk == null; if ( !first ) { currentChunk.close(); if ( bufferPos - seekStartPos >= dataCapacity ) { throw new BufferOverflowException( "Tried to read a field larger than buffer size " + dataLength + ". A common cause of this is that a field has an unterminated " + "quote and so will try to seek until the next quote, which ever line it may be on." + " This should not happen if multi-line fields are disabled, given that the fields contains " + "no new-line characters. This field started at " + sourceDescription() + ":" + lineNumber() ); } } absoluteBufferStartPosition += dataLength; Chunk nextChunk = source.nextChunk( first ? -1 : seekStartPos ); if ( nextChunk.backPosition() == nextChunk.startPosition() + nextChunk.length() ) { return false; } buffer = nextChunk.data(); dataLength = nextChunk.length(); dataCapacity = nextChunk.maxFieldSize(); bufferPos = nextChunk.startPosition(); bufferEnd = bufferPos + dataLength; int shift = seekStartPos - nextChunk.backPosition(); seekStartPos = nextChunk.backPosition(); if ( first ) { lineStartPos = seekStartPos; } else { lineStartPos -= shift; } String sourceDescriptionAfterRead = nextChunk.sourceDescription(); if ( !sourceDescriptionAfterRead.equals( sourceDescription ) ) { lineNumber = 0; sourceDescription = sourceDescriptionAfterRead; } currentChunk = nextChunk; return dataLength > 0; } return true; }
Source:
public void testCostDefault() { Double jobCost = JobHistoryFileParserBase.calculateJobCost(100L, Constants.DEFAULT_COMPUTE_TCO, Constants.DEFAULT_MACHINE_MEMORY); assertEquals(1.413850E-10, jobCost, 0.0001); jobCost = JobHistoryFileParserBase.calculateJobCost(10000000000000L, Constants.DEFAULT_COMPUTE_TCO, Constants.DEFAULT_MACHINE_MEMORY); assertEquals(14.128503, jobCost, 0.0001); jobCost = JobHistoryFileParserBase.calculateJobCost(100L, 20.0, 512L); assertEquals(1.413850E-10, jobCost, 0.0001); jobCost = JobHistoryFileParserBase.calculateJobCost(10000000000000L, 20.0, 512L); assertEquals(4521.122685, jobCost, 0.0001); }

Target:
public void testCostDefault() { Double jobCost = JobHistoryFileParserBase.calculateJobCost(100L, 0.0, 0L); assertEquals(0.0, jobCost, 0.0001); jobCost = JobHistoryFileParserBase.calculateJobCost(100L, 20.0, 512L); assertEquals(1.413850E-10, jobCost, 0.0001); }
Source:
ByteBuffer pollCachedNioBuffer() { return cachedNioBuffers.pollLast(); }

Target:
ByteBuffer pollCachedNioBuffer() { return cachedNioBuffers != null ? cachedNioBuffers.pollLast() : null; }
Source:
public EntityLaunchListener(SystemServiceEnricher enricher) { this.enricher = enricher; }

Target:
public EntityLaunchListener(SystemServiceEnricher enricher) { this.enricher = checkNotNull(enricher, "enricher"); }
Source:
public void validate() throws Exception { if (toInteger(hasTag("setconf")) + toInteger(hasTag("getconf")) + toInteger(hasTag("auth")) + toInteger(hasTag("get")) + toInteger(hasTag("set")) > 1) { throw new Exception("The message tag must be either setconf, getconf, auth or set"); } if (hasTag("setconf")) { if (getText() == null) { throw new Exception("The setconf message must contain a text."); } } else if (hasTag("getconf")) { if (getText() != null) { throw new Exception("The getconf message should not contain a text."); } if (getTags().size() != 1) { throw new Exception("The getconf message should be the only tag."); } } else if (hasTag("set") || hasTag("get")) { if (getText() == null) { throw new Exception("The get/set message must contain a text."); } if (getTags().size() != 1) { throw new Exception("The get/set message should be the only tag."); } } else if (hasTag("auth")) { if (!"reload".equalsIgnoreCase(getText())) { throw new Exception("The auth message can only accept a text \"reload\"."); } if (getTags().size() != 1) { throw new Exception("The auth message should be the only tag."); } } else { throw new Exception("The message tag must be either setconf, getconf, auth or set"); } super.validate(); }

Target:
public void validate() throws Exception { Set<String> allowedTags = new TreeSet<>(Arrays.asList("setconf", "getconf", "auth", "get", "set")); Set<String> tagCopy = new TreeSet<>(allowedTags); tagCopy.retainAll(getTags()); if (tagCopy.size() > 1) { throw new Exception("The message tag must be one of '" + allowedTags.toString() + "'"); } if (hasTag("setconf")) { if (getText() == null) { throw new Exception("The setconf message must contain a text."); } } else if (hasTag("getconf")) { if (getText() != null) { throw new Exception("The getconf message should not contain a text."); } if (getTags().size() != 1) { throw new Exception("The getconf message should be the only tag."); } } else if (hasTag("set") || hasTag("get")) { if (getText() == null) { throw new Exception("The get/set message must contain a text."); } if (getTags().size() != 1) { throw new Exception("The get/set message should be the only tag."); } } else if (hasTag("auth")) { if (!"reload".equalsIgnoreCase(getText())) { throw new Exception("The auth message can only accept a text \"reload\"."); } if (getTags().size() != 1) { throw new Exception("The auth message should be the only tag."); } } else { throw new Exception("The message tag must be either setconf, getconf, auth or set"); } super.validate(); }
Source:
private void autoShareProjects(File repositoryDir) { IPath workingDirPath = new Path(repositoryDir.getAbsolutePath()) .removeLastSegments(1); Map<IProject, File> connections = new HashMap<IProject, File>(); IProject[] projects = ResourcesPlugin.getWorkspace().getRoot() .getProjects(); for (IProject project : projects) { RepositoryProvider provider = RepositoryProvider .getProvider(project); if (provider != null) continue; IPath location = project.getLocation(); if (location == null) continue; if (!workingDirPath.isPrefixOf(location)) continue; RepositoryFinder f = new RepositoryFinder(project); try { Collection<RepositoryMapping> mappings = f .find(new NullProgressMonitor()); if (mappings.size() == 1) { connections.put(project, repositoryDir); } } catch (CoreException e) { continue; } } if (!connections.isEmpty()) { ConnectProviderOperation operation = new ConnectProviderOperation( connections); JobUtil.scheduleUserJob(operation, CoreText.Activator_AutoShareJobName, JobFamilies.AUTO_SHARE); } }

Target:
private void autoShareProjects(File repositoryDir) { IPath workingDirPath = new Path(repositoryDir.getAbsolutePath()) .removeLastSegments(1); Map<IProject, File> connections = new HashMap<IProject, File>(); IProject[] projects = ResourcesPlugin.getWorkspace().getRoot() .getProjects(); for (IProject project : projects) { RepositoryProvider provider = RepositoryProvider .getProvider(project); if (provider != null) continue; IPath location = project.getLocation(); if (location == null) continue; if (!workingDirPath.isPrefixOf(location)) continue; RepositoryFinder f = new RepositoryFinder(project); try { Collection<RepositoryMapping> mappings = f .find(new NullProgressMonitor()); if (mappings.size() == 1) connections.put(project, repositoryDir); } catch (CoreException e) { continue; } } if (!connections.isEmpty()) { ConnectProviderOperation operation = new ConnectProviderOperation( connections); JobUtil.scheduleUserJob(operation, CoreText.Activator_AutoShareJobName, JobFamilies.AUTO_SHARE); } }
Source:
public void testTopologyLevelClassCastExceptionDirect() { final ProcessorNode node = new ProcessorNode("name", new ClassCastProcessor(), Collections.emptySet()); try { node.process("aKey", "aValue"); } catch (final StreamsException e) { assertThat(e.getCause(), instanceOf(ClassCastException.class)); assertThat(e.getMessage(), containsString("default serdes")); assertThat(e.getMessage(), containsString("input types")); throw e; } }

Target:
public void testTopologyLevelClassCastExceptionDirect() { final ProcessorNode<Object, Object> node = new ProcessorNode<Object, Object>("name", new ClassCastProcessor(), Collections.<String>emptySet()); final StreamsException se = assertThrows(StreamsException.class, () -> node.process("aKey", "aValue")); assertThat(se.getCause(), instanceOf(ClassCastException.class)); assertThat(se.getMessage(), containsString("default Serdes")); assertThat(se.getMessage(), containsString("input types")); }
Source:
public static void beforeInitMilestonePluginsStarted() { LOG.info("\n\n LOCKABLE RESOURCES COMPATABILITY INIT \n\n"); List<LockableResource> resources = LockableResourcesManager.get().getResources(); for (LockableResource resource : resources) { List<StepContext> queuedContexts = resource.getQueuedContexts(); if (queuedContexts.size() > 0) { for (StepContext queuedContext : queuedContexts) { List<String> resourcesNames = new ArrayList<String>(); resourcesNames.add(resource.getName()); LockableResourcesStruct resourceHolder = new LockableResourcesStruct(resourcesNames, "", 0); LockableResourcesManager.get().queueContext(queuedContext, resourceHolder, resource.getName()); } } } }

Target:
public static void beforeInitMilestonePluginsStarted() { LOG.fine("\n\n LOCKABLE RESOURCES COMPATABILITY INIT \n\n"); List<LockableResource> resources = LockableResourcesManager.get().getResources(); for (LockableResource resource : resources) { List<StepContext> queuedContexts = resource.getQueuedContexts(); if (queuedContexts.size() > 0) { for (StepContext queuedContext : queuedContexts) { List<String> resourcesNames = new ArrayList<String>(); resourcesNames.add(resource.getName()); LockableResourcesStruct resourceHolder = new LockableResourcesStruct(resourcesNames, "", 0); LockableResourcesManager.get().queueContext(queuedContext, resourceHolder, resource.getName()); } queuedContexts.clear(); } } }
Source:
public Flux<?> adapt(final SubscribableChannel boundElement, MethodParameter parameter) { ResolvableType resolvableType = ResolvableType.forMethodParameter(parameter); final Class<?> argumentClass = (resolvableType.getGeneric(0).getRawClass() != null) ? (resolvableType .getGeneric(0).getRawClass()) : Object.class; final Object monitor = new Object(); if (Message.class.isAssignableFrom(argumentClass)) { return Flux.create(emitter -> { MessageHandler messageHandler = message -> { synchronized (monitor) { emitter.next(message); } }; boundElement.subscribe(messageHandler); emitter.setCancellation(() -> boundElement.unsubscribe(messageHandler)); }).publish().autoConnect(); } else { return Flux.create(emitter -> { MessageHandler messageHandler = message -> { synchronized (monitor) { if (argumentClass.equals(Object.class) || argumentClass.isAssignableFrom(message .getPayload().getClass())) { emitter.next(message.getPayload()); } else { emitter.next(this.messageConverter.fromMessage(message, argumentClass)); } } }; boundElement.subscribe(messageHandler); emitter.setCancellation(() -> boundElement.unsubscribe(messageHandler)); }).publish().autoConnect(); } }

Target:
public Flux<?> adapt(final SubscribableChannel boundElement, MethodParameter parameter) { ResolvableType resolvableType = ResolvableType.forMethodParameter(parameter); final Class<?> argumentClass = (resolvableType.getGeneric(0).getRawClass() != null) ? (resolvableType .getGeneric(0).getRawClass()) : Object.class; final Object monitor = new Object(); if (Message.class.isAssignableFrom(argumentClass)) { return Flux.create(emitter -> { MessageHandler messageHandler = message -> { synchronized (monitor) { emitter.next(message); } }; boundElement.subscribe(messageHandler); emitter.setCancellation(() -> boundElement.unsubscribe(messageHandler)); }).publish().autoConnect(); } else { return Flux.create(emitter -> { MessageHandler messageHandler = message -> { synchronized (monitor) { if (argumentClass.isAssignableFrom(message .getPayload().getClass())) { emitter.next(message.getPayload()); } else { emitter.next(this.messageConverter.fromMessage(message, argumentClass)); } } }; boundElement.subscribe(messageHandler); emitter.setCancellation(() -> boundElement.unsubscribe(messageHandler)); }).publish().autoConnect(); } }
Source:
public void addListener(AbstractCacheListener listener){ if(cacheListeners == null){ cacheListeners = new ArrayList<AbstractCacheListener>(); } cacheListeners.add(listener); }

Target:
public void addListener(AbstractCacheListener listener){ cacheListeners.add(listener); }
Source:
private TaskData doInBackgroundLoadStatistics(TaskData... params) { Log.i(AnkiDroidApp.TAG, "doInBackgroundLoadStatistics"); Collection col = params[0].getCollection(); int type = params[0].getInt(); boolean wholeCollection = params[0].getBoolean(); Stats stats = new Stats(col, wholeCollection); Stats.ChartPeriodType chartPeriodType = Stats.ChartPeriodType.valueOf(AnkiDroidApp.getSharedPrefs( AnkiDroidApp.getInstance().getBaseContext()).getInt("statsType", Stats.TYPE_MONTH)); switch (type) { default: case Stats.TYPE_FORECAST: return new TaskData(stats.calculateDue(chartPeriodType)); case Stats.TYPE_REVIEW_COUNT: return new TaskData(stats.calculateDone(chartPeriodType, true)); case Stats.TYPE_REVIEW_TIME: return new TaskData(stats.calculateDone(chartPeriodType, false)); case Stats.TYPE_INTERVALS: return new TaskData(stats.calculateIntervals(chartPeriodType)); case Stats.TYPE_HOURLY_BREAKDOWN: return new TaskData(stats.calculateBreakdown(chartPeriodType)); case Stats.TYPE_WEEKLY_BREAKDOWN: return new TaskData(stats.calculateWeeklyBreakdown(chartPeriodType)); case Stats.TYPE_ANSWER_BUTTONS: return new TaskData(stats.calculateAnswerButtons(chartPeriodType)); case Stats.TYPE_CARDS_TYPES: return new TaskData(stats.calculateCardsTypes(chartPeriodType)); } }

Target:
private TaskData doInBackgroundLoadStatistics(TaskData... params) { Log.i(AnkiDroidApp.TAG, "doInBackgroundLoadStatistics"); Collection col = params[0].getCollection(); int type = params[0].getInt(); boolean wholeCollection = params[0].getBoolean(); Stats stats = new Stats(col, wholeCollection); int chartPeriodType = AnkiDroidApp.getSharedPrefs( AnkiDroidApp.getInstance().getBaseContext()).getInt("statsType", Stats.TYPE_MONTH); switch (type) { default: case Stats.TYPE_FORECAST: return new TaskData(stats.calculateDue(chartPeriodType)); case Stats.TYPE_REVIEW_COUNT: return new TaskData(stats.calculateDone(chartPeriodType, true)); case Stats.TYPE_REVIEW_TIME: return new TaskData(stats.calculateDone(chartPeriodType, false)); case Stats.TYPE_INTERVALS: return new TaskData(stats.calculateIntervals(chartPeriodType)); case Stats.TYPE_HOURLY_BREAKDOWN: return new TaskData(stats.calculateBreakdown(chartPeriodType)); case Stats.TYPE_WEEKLY_BREAKDOWN: return new TaskData(stats.calculateWeeklyBreakdown(chartPeriodType)); case Stats.TYPE_ANSWER_BUTTONS: return new TaskData(stats.calculateAnswerButtons(chartPeriodType)); case Stats.TYPE_CARDS_TYPES: return new TaskData(stats.calculateCardsTypes(chartPeriodType)); } }
Source:
File getSurefireTempDir() { File result = IS_OS_WINDOWS ? createSurefireBootDirectoryInTemp() : createSurefireBootDirectoryInBuild(); try { File canonical = result.getCanonicalFile(); if ( !result.equals( canonical ) ) { logger.debug( "Canonicalized tempDir path " + result + " to " + canonical ); } return canonical; } catch ( IOException err ) { logger.error( "Could not canonicalize tempDir path '" + result + "'", err ); } return result; }

Target:
File getSurefireTempDir() { File result = IS_OS_WINDOWS ? createSurefireBootDirectoryInTemp() : createSurefireBootDirectoryInBuild(); try { File canonical = result.getCanonicalFile(); if ( !result.equals( canonical ) ) { logger.debug( "Canonicalized tempDir path '" + result + "' to '" + canonical + "'" ); } return canonical; } catch ( IOException e ) { logger.error( "Could not canonicalize tempDir path '" + result + "'", e ); } return result; }
Source:
private Set<Plugin> addMissingDependencies(Map<Plugin, List<Plugin>> plugins) { if (!plugins.containsKey(this)) { plugins.put(this, getNeededDependencies()); } for (Plugin p : plugins.get(this)) { if (plugins.get(p) == null) { p.addMissingDependencies(plugins); } } Set<Plugin> allDependencies = new HashSet<Plugin>(); for (List<Plugin> pluginDependencies : plugins.values()) { allDependencies.addAll(pluginDependencies); } allDependencies.remove(this); return allDependencies; }

Target:
private void addMissingDependencies(Map<Plugin, List<Plugin>> plugins) { boolean alreadyAdded = false; Optional<Plugin> plugin = plugins.keySet().stream().filter(item -> item.name.equals(this.name)).findFirst(); if (plugin.isPresent()) { if(new VersionNumber(plugin.get().version).isOlderThan(new VersionNumber(this.version))) { plugins.remove(plugin.get()); } else { alreadyAdded = true; } } if(!alreadyAdded) { plugins.put(this, getNeededDependencies()); for (Plugin p : plugins.get(this)) { Optional<Plugin> old = plugins.keySet().stream().filter(item -> item.name.equals(p.name)).findFirst(); if (!old.isPresent() || new VersionNumber(old.get().version).isOlderThan(new VersionNumber(p.version))) { p.addMissingDependencies(plugins); } } } }
Source:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof EventDeclaration)) { return false; } EventDeclaration other = (EventDeclaration) obj; if (context == null) { if (other.context != null) { return false; } } else if (!context.equals(other.context)) { return false; } if (fields == null) { if (other.fields != null) { return false; } } else if (!fields.equals(other.fields)) { return false; } if (id == null) { if (other.id != null) { return false; } } else if (!id.equals(other.id)) { return false; } if (name == null) { if (other.name != null) { return false; } } else if (!name.equals(other.name)) { return false; } if (stream == null) { if (other.stream != null) { return false; } } else if (!stream.equals(other.stream)) { return false; } return true; }

Target:
public boolean equals(Object obj) { if (this == obj) { return true; } if (obj == null) { return false; } if (!(obj instanceof EventDeclaration)) { return false; } EventDeclaration other = (EventDeclaration) obj; if (context == null) { if (other.context != null) { return false; } } else if (!context.equals(other.context)) { return false; } if (fields == null) { if (other.fields != null) { return false; } } else if (!fields.equals(other.fields)) { return false; } if (id == null) { if (other.id != null) { return false; } } else if (!id.equals(other.id)) { return false; } if (name == null) { if (other.name != null) { return false; } } else if (!name.equals(other.name)) { return false; } if (stream == null) { if (other.stream != null) { return false; } } else if (!stream.equals(other.stream)) { return false; } if (!customAttributes.equals(other.customAttributes)) { return false; } return true; }
Source:
public String readableString() { StringBuilder serviceConfigurationsToStringBuilder = new StringBuilder(); for (ServiceConfiguration serviceConfiguration : serviceConfigurations) { serviceConfigurationsToStringBuilder .append("- "); if(serviceConfiguration instanceof HumanReadable) { serviceConfigurationsToStringBuilder .append(((HumanReadable)serviceConfiguration).readableString()) .append("\n"); } else { serviceConfigurationsToStringBuilder .append(serviceConfiguration.getClass().getName()) .append("\n"); } } if(serviceConfigurationsToStringBuilder.length() > 0) { serviceConfigurationsToStringBuilder.deleteCharAt(serviceConfigurationsToStringBuilder.length() -1); } StringBuilder cacheConfigurationListenerToStringBuilder = new StringBuilder(); for (CacheConfigurationChangeListener cacheConfigurationChangeListener : cacheConfigurationListenerList) { cacheConfigurationListenerToStringBuilder .append("- ") .append(cacheConfigurationChangeListener.getClass().getName()) .append("\n"); } if(!cacheConfigurationListenerList.isEmpty()) { cacheConfigurationListenerToStringBuilder.deleteCharAt(cacheConfigurationListenerToStringBuilder.length() -1); } return "keyType: " + keyType.getName() + "\n " + "valueType: " + valueType.getName() + "\n " + "serviceConfigurations:\n " + serviceConfigurationsToStringBuilder.toString().replace("\n", "\n ") + "\n " + "evictionAdvisor: " + ((evictionAdvisor != null) ? evictionAdvisor.getClass().getName() : "") + "\n " + "expiry: " + ((expiry != null) ? expiry.getClass().getSimpleName() : "") + "\n " + "resourcePools: " + "\n " + ((resourcePools instanceof HumanReadable) ? ((HumanReadable)resourcePools).readableString() : "").replace("\n", "\n "); }

Target:
public String readableString() { StringBuilder serviceConfigurationsToStringBuilder = new StringBuilder(); for (ServiceConfiguration serviceConfiguration : serviceConfigurations) { serviceConfigurationsToStringBuilder .append("- "); if(serviceConfiguration instanceof HumanReadable) { serviceConfigurationsToStringBuilder .append(((HumanReadable)serviceConfiguration).readableString()) .append("\n"); } else { serviceConfigurationsToStringBuilder .append(serviceConfiguration.getClass().getName()) .append("\n"); } } if(serviceConfigurationsToStringBuilder.length() > 0) { serviceConfigurationsToStringBuilder.deleteCharAt(serviceConfigurationsToStringBuilder.length() -1); } return "keyType: " + keyType.getName() + "\n" + "valueType: " + valueType.getName() + "\n" + "serviceConfigurations:\n " + serviceConfigurationsToStringBuilder.toString().replace("\n", "\n ") + "\n" + "evictionAdvisor: " + ((evictionAdvisor != null) ? evictionAdvisor.getClass().getName() : "") + "\n" + "expiry: " + ((expiry != null) ? expiry.getClass().getSimpleName() : "") + "\n" + "resourcePools: " + "\n " + ((resourcePools instanceof HumanReadable) ? ((HumanReadable)resourcePools).readableString() : "").replace("\n", "\n "); }
Source:
private synchronized void updateInternal(TimelockAuthConfiguration authConfiguration) { authServices = getAuthServices(authConfiguration); }

Target:
private synchronized AuthServices updateInternal(TimelockAuthConfiguration authConfiguration) { return authServices.updateAndGet(ignored -> getAuthServices(authConfiguration)); }
Source:
public void updateVmConfiguration(final INewAsyncCallback onUpdateAsyncCallback) { Snapshot snapshot = getEntity(); if (snapshot == null) { return; } AsyncDataProvider.getInstance().getVmConfigurationBySnapshot(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { SnapshotModel snapshotModel = (SnapshotModel) target; Snapshot snapshot = snapshotModel.getEntity(); VM vm = (VM) returnValue; if (vm != null && snapshot != null) { snapshotModel.setVm(vm); snapshotModel.setDisks(vm.getDiskList()); snapshotModel.setNics(vm.getInterfaces()); snapshotModel.setApps(Arrays.asList(snapshot.getAppList() != null ? snapshot.getAppList().split(",") : new String[]{})); Collections.sort(snapshotModel.getDisks(), new Linq.DiskByAliasComparer()); Collections.sort(snapshotModel.getNics(), VmNetworkInterfaceComparator.BY_NAME); } onUpdateAsyncCallback.onSuccess(snapshotModel, null); } }), snapshot.getId()); }

Target:
public void updateVmConfiguration(final INewAsyncCallback onUpdateAsyncCallback) { Snapshot snapshot = getEntity(); if (snapshot == null) { return; } AsyncDataProvider.getInstance().getVmConfigurationBySnapshot(new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object target, Object returnValue) { SnapshotModel snapshotModel = (SnapshotModel) target; Snapshot snapshot = snapshotModel.getEntity(); VM vm = (VM) returnValue; if (vm != null && snapshot != null) { snapshotModel.setVm(vm); snapshotModel.setDisks(vm.getDiskList()); snapshotModel.setNics(vm.getInterfaces()); snapshotModel.setApps(Arrays.asList(snapshot.getAppList() != null ? snapshot.getAppList().split(",") : new String[]{})); Collections.sort(snapshotModel.getDisks(), new Linq.DiskByAliasComparer()); Collections.sort(snapshotModel.getNics(), new Linq.VmInterfaceComparer()); } onUpdateAsyncCallback.onSuccess(snapshotModel, null); } }), snapshot.getId()); }
Source:
public long getEventsInRange(long start, long end) { long startCount; if (start == stats.getStartTime()) { startCount = 0; } else { startCount = getEventCountAt(start - 1); } long endCount = getEventCountAt(end); return endCount - startCount; }

Target:
public long getEventsInRange(long start, long end) { stats.waitUntilBuilt(); long startCount; if (start == stats.getStartTime()) { startCount = 0; } else { startCount = getEventCountAt(start - 1); } long endCount = getEventCountAt(end); return endCount - startCount; }
Source:
public List<Future<?>> getFutures() { return futures; }

Target:
List<Future<?>> getFutures() { return futures; }
Source:
public ProjectState() throws IOException { config = new SimpleObjectProperty<>(); service = new SimpleObjectProperty<>(); metadata = new SimpleObjectProperty<>(); config.addListener((obs, oldVal, newVal) -> { if (newVal == null) { service.set(null); metadata.set(null); } else if (oldVal != newVal) { service.set(ProjectService.create(newVal)); } }); }

Target:
public ProjectState() { config = new SimpleObjectProperty<>(); }
Source:
private void updateHaMaintenanceAvailability(List items) { if (items == null || items.size() != 1) { setHaMaintenanceAvailability(false); return; } VM vm = (VM) getSelectedItem(); if (vm == null || !vm.isHostedEngine() || vm.getVdsGroupCompatibilityVersion().compareTo(Version.v3_4) < 0) { setHaMaintenanceAvailability(false); return; } Frontend.getInstance().runQuery(VdcQueryType.GetVdsByVdsId, new IdQueryParameters(vm.getRunOnVds()), new AsyncQuery(this, new INewAsyncCallback() { @Override public void onSuccess(Object model, Object returnValue) { VdcQueryReturnValue response = (VdcQueryReturnValue) returnValue; if (response == null || !response.getSucceeded() || response.getReturnValue() == null) { setHaMaintenanceAvailability(false); } else { VDS vds = response.getReturnValue(); setHaMaintenanceAvailability(vds.getHighlyAvailableIsConfigured()); } } }, true)); }

Target:
private void updateHaMaintenanceAvailability(List items) { if (items == null || items.size() != 1) { setHaMaintenanceAvailability(false); return; } VM vm = (VM) getSelectedItem(); if (vm == null || !vm.isHostedEngine() || vm.getVdsGroupCompatibilityVersion().compareTo(Version.v3_4) < 0) { setHaMaintenanceAvailability(false); } else { setHaMaintenanceAvailability(true); } }
Source:
public void setUp() throws CTFException { fTrace = new CtfTmfTrace(); int capacity = 2048; ByteBuffer bb = ByteBuffer.allocateDirect(capacity); StructDeclaration sDec = new StructDeclaration(1l); IntegerDeclaration intDec = IntegerDeclaration.INT_8_DECL; sDec.addField("cpu_id", intDec); sDec.addField("CpuId", intDec); bb.put((byte) 2); bb.put((byte) 3); StructDefinition def = sDec.createDefinition(null, ROOT, new BitBuffer(bb)); EventDeclaration dec = new EventDeclaration(); dec.setName("hi"); fEvents.add(new EventDefinition(dec, -1, 0, null, null, null, null, def, null)); fEvents.add(new EventDefinition(dec, 3, 0, null, null, null, null, def, null)); fEvents.add(new EventDefinition(dec, -1, 0, null, null, null, def, null, null)); fEvents.add(new EventDefinition(dec, -1, 0, null, null, null, null, null, null)); }

Target:
public void setUp() throws CTFException { fTrace = new CtfTmfTrace(); int capacity = 2048; ByteBuffer bb = ByteBuffer.allocateDirect(capacity); StructDeclaration sDec = new StructDeclaration(1l); IntegerDeclaration intDec = IntegerDeclaration.INT_8_DECL; sDec.addField("cpu_id", intDec); sDec.addField("CpuId", intDec); bb.put((byte) 2); bb.put((byte) 3); StructDefinition def = sDec.createDefinition(null, ROOT, new BitBuffer(bb)); EventDeclaration dec = new EventDeclaration(); dec.setName("hi"); fEvents.add(new EventDefinition(dec, IEventDefinition.UNKNOWN_CPU, 0, null, null, null, null, def, null)); fEvents.add(new EventDefinition(dec, 3, 0, null, null, null, null, def, null)); fEvents.add(new EventDefinition(dec, IEventDefinition.UNKNOWN_CPU, 0, null, null, null, def, null, null)); fEvents.add(new EventDefinition(dec, IEventDefinition.UNKNOWN_CPU, 0, null, null, null, null, null, null)); fEvents.add(new EventDefinition(dec, 6, 0, null, null, null, null, null, null)); }
Source:
public void initialize() { logger.debug("Initializing hue light handler."); final String configLightId = (String) getConfig().get(LIGHT_ID); if (configLightId != null) { lightId = configLightId; if (getHueBridgeHandler() != null) { ThingStatusInfo statusInfo = getBridge().getStatusInfo(); updateStatus(statusInfo.getStatus(), statusInfo.getStatusDetail(), statusInfo.getDescription()); FullLight fullLight = getLight(); if (fullLight != null) { updateProperty(Thing.PROPERTY_FIRMWARE_VERSION, fullLight.getSoftwareVersion()); String thingUID = fullLight.getModelID(); if (thingUID.equals("PAR16 50 TW")) { isOsramPar16 = true; } } } } }

Target:
public void initialize() { logger.debug("Initializing hue light handler."); final String configLightId = (String) getConfig().get(LIGHT_ID); if (configLightId != null) { lightId = configLightId; if (getHueBridgeHandler() != null) { ThingStatusInfo statusInfo = getBridge().getStatusInfo(); updateStatus(statusInfo.getStatus(), statusInfo.getStatusDetail(), statusInfo.getDescription()); FullLight fullLight = getLight(); if (fullLight != null) { updateProperty(Thing.PROPERTY_FIRMWARE_VERSION, fullLight.getSoftwareVersion()); String thingUID = fullLight.getModelID(); if (thingUID.equals(OSRAM_PAR16_MODELID)) { isOsramPar16 = true; } } } } }
Source:
protected void executeVmCommand() { ImagesHandler.setDiskAlias(getParameters().getDiskInfo(), getVm()); if (resizeDiskImageRequested()) { switch (getOldDisk().getDiskStorageType()) { case IMAGE: extendDiskImageSize(); break; case CINDER: extendCinderDiskSize(); break; } } else { try { boolean shouldUpdate = true; if (Objects.equals(getOldDisk().getDiskStorageType(), DiskStorageType.IMAGE) && amendDiskRequested()) { amendDiskImage(); shouldUpdate = getSucceeded(); } if (shouldUpdate) { performDiskUpdate(false); } } finally { freeLock(); } } }

Target:
protected void executeVmCommand() { ImagesHandler.setDiskAlias(getParameters().getDiskInfo(), getVm()); if (resizeDiskImageRequested()) { switch (getOldDisk().getDiskStorageType()) { case IMAGE: extendDiskImageSize(); break; case CINDER: extendCinderDiskSize(); break; } } else { try { performDiskUpdate(false); if (Objects.equals(getOldDisk().getDiskStorageType(), DiskStorageType.IMAGE) && amendDiskRequested()) { amendDiskImage(); } } finally { freeLock(); } } }
Source:
public Optional<Charge> findByProviderAndTransactionIdFromDbOrLedger(String paymentGatewayName, String gatewayTransactionId) { Optional<ChargeEntity> maybeChargeEntity = chargeDao.findByProviderAndTransactionId(paymentGatewayName, gatewayTransactionId); if(maybeChargeEntity.isPresent()) { return maybeChargeEntity.map(Charge::from); } else{ return ledgerService.getTransactionForProviderAndGatewayTransactionId(paymentGatewayName,gatewayTransactionId) .map(Charge::from); } }

Target:
public Optional<Charge> findByProviderAndTransactionIdFromDbOrLedger(String paymentGatewayName, String gatewayTransactionId) { return Optional.ofNullable(chargeDao.findByProviderAndTransactionId(paymentGatewayName, gatewayTransactionId) .map(Charge::from) .orElseGet(() -> findChargeFromLedger(paymentGatewayName, gatewayTransactionId).orElse(null))); }
Source:
public boolean canAccessTarget(JobStatus target, SubResource subResource, Access required) { boolean principalNameMatch = target.getPrincipalName().equals(principalName); String ownerId = target.getOwnerId(); boolean ownerOk = ownerId != null && allowedOrgIds.contains(ownerId); if (!ownerOk) { return false; } if (JobStatus.TargetType.OWNER.name().equalsIgnoreCase(target.getTargetType()) && !ownerId.equals(target.getTargetId())) { return false; } if ("user".equalsIgnoreCase(principalType)) { if (principalNameMatch) { return Access.ALL.provides(required); } else { return Access.READ_ONLY.provides(required); } } else if ("consumer".equalsIgnoreCase(principalType)) { return Access.ALL.provides(required) && principalNameMatch; } else { return false; } }

Target:
public boolean canAccessTarget(JobStatus target, SubResource subResource, Access required) { boolean principalNameMatch = target.getPrincipalName().equals(principalName); String ownerId = target.getOwnerId(); boolean ownerOk = ownerId != null && allowedOrgIds.contains(ownerId); if (!ownerOk) { return false; } if (JobStatus.TargetType.OWNER.name().equalsIgnoreCase(target.getTargetType()) && !ownerId.equals(target.getTargetId())) { return false; } if ("user".equalsIgnoreCase(principalType)) { if (principalNameMatch) { return Access.ALL.provides(required); } else { return Access.READ_ONLY.provides(required); } } else if ("consumer".equalsIgnoreCase(principalType)) { return Access.ALL.provides(required) && principalNameMatch; } return false; }
Source:
private void applyChangesFromList(View rootView, List<ViewVisitor> changes) { synchronized (mCurrentEdits) { final int size = changes.size(); for (int i = 0; i < size; i++) { final ViewVisitor visitor = changes.get(i); try { final EditBinding binding = new EditBinding(rootView, visitor, mUiThreadHandler); mCurrentEdits.add(binding); } catch (ViewVisitor.LayoutUpdateException e) { mEditErrorMessage.sendErrorMessage(e.getErrorInfo()); } } } }

Target:
private void applyChangesFromList(View rootView, List<ViewVisitor> changes) { synchronized (mCurrentEdits) { final int size = changes.size(); for (int i = 0; i < size; i++) { final ViewVisitor visitor = changes.get(i); final EditBinding binding = new EditBinding(rootView, visitor, mUiThreadHandler); mCurrentEdits.add(binding); } } }
Source:
public void train(int diseaseGroupId, List<DiseaseOccurrence> occurrences) throws MachineWeightingPredictorException { try { webService.sendTrainingData(diseaseGroupId, occurrences); } catch (WebServiceClientException|JsonProcessingException e) { LOGGER.error(e.getMessage()); throw new MachineWeightingPredictorException(TRAINING_FAILURE); } }

Target:
public void train(int diseaseGroupId, List<DiseaseOccurrence> occurrences) throws MachineWeightingPredictorException { try { LOGGER.info(String.format(TRAINING_MESSAGE, diseaseGroupId, occurrences.size())); webService.sendTrainingData(diseaseGroupId, occurrences); } catch (WebServiceClientException|JsonProcessingException e) { LOGGER.error(e.getMessage()); throw new MachineWeightingPredictorException(TRAINING_FAILURE); } }
Source:
private Map<String, SystemStreamMetadata> fetchSystemStreamMetadata(Set<String> topics) { Map<SystemStreamPartition, String> allOldestOffsets = new HashMap<>(); Map<SystemStreamPartition, String> allNewestOffsets = new HashMap<>(); Map<SystemStreamPartition, String> allUpcomingOffsets = new HashMap<>(); LOG.info("Fetching SystemStreamMetadata for topics on system {}", topics, systemName); topics.forEach(topic -> { List<PartitionInfo> partitionInfos = threadSafeKafkaConsumer.execute(consumer -> consumer.partitionsFor(topic)); if (partitionInfos == null) { String msg = String.format("Partition info not(yet?) available for system %s topic %s", systemName, topic); throw new SamzaException(msg); } List<TopicPartition> topicPartitions = partitionInfos.stream() .map(partitionInfo -> new TopicPartition(partitionInfo.topic(), partitionInfo.partition())) .collect(Collectors.toList()); OffsetsMaps offsetsForTopic = fetchTopicPartitionsMetadata(topicPartitions); allOldestOffsets.putAll(offsetsForTopic.getOldestOffsets()); allNewestOffsets.putAll(offsetsForTopic.getNewestOffsets()); allUpcomingOffsets.putAll(offsetsForTopic.getUpcomingOffsets()); }); return assembleMetadata(allOldestOffsets, allNewestOffsets, allUpcomingOffsets); }

Target:
private Map<String, SystemStreamMetadata> fetchSystemStreamMetadata(Set<String> topics) { Map<SystemStreamPartition, String> allOldestOffsets = new HashMap<>(); Map<SystemStreamPartition, String> allNewestOffsets = new HashMap<>(); Map<SystemStreamPartition, String> allUpcomingOffsets = new HashMap<>(); LOG.info("Fetching SystemStreamMetadata for topics on system {}", topics, systemName); topics.forEach(topic -> { OffsetsMaps offsetsForTopic = threadSafeKafkaConsumer.execute(consumer -> { List<PartitionInfo> partitionInfos = consumer.partitionsFor(topic); if (partitionInfos == null) { String msg = String.format("Partition info not(yet?) available for system %s topic %s", systemName, topic); throw new SamzaException(msg); } List<TopicPartition> topicPartitions = partitionInfos.stream() .map(partitionInfo -> new TopicPartition(partitionInfo.topic(), partitionInfo.partition())) .collect(Collectors.toList()); return fetchTopicPartitionsMetadata(topicPartitions); }); allOldestOffsets.putAll(offsetsForTopic.getOldestOffsets()); allNewestOffsets.putAll(offsetsForTopic.getNewestOffsets()); allUpcomingOffsets.putAll(offsetsForTopic.getUpcomingOffsets()); }); return assembleMetadata(allOldestOffsets, allNewestOffsets, allUpcomingOffsets); }
Source:
private static void checkInstallConfig(AtlasDbConfig config) { if (config.getSweepBatchSize() != null || config.getSweepCellBatchSize() != null || config.getSweepReadLimit() != null || config.getSweepCandidateBatchHint() != null || config.getSweepDeleteBatchHint() != null) { log.error("Your configuration specifies sweep parameters on the install config." + " Please use the runtime config to specify them."); } }

Target:
private static void checkInstallConfig(AtlasDbConfig config) { if (config.getSweepBatchSize() != null || config.getSweepCellBatchSize() != null || config.getSweepReadLimit() != null || config.getSweepCandidateBatchHint() != null || config.getSweepDeleteBatchHint() != null) { log.error("Your configuration specifies sweep parameters on the install config. They will be ignored." + " Please use the runtime config to specify them."); } }
Source:
public void authenticate(String username, final String password, final AsyncCallback<LoginResult> callback) { LoginResult result = new LoginResult(); if (username == null || "".equals(username.trim()) || password == null || "".equals(password)) { result.success = false; callback.onSuccess(result); return; } username = username.trim(); final AuthRequest req = AuthRequest.forUser(username); req.setPassword(password); final AuthResult res; try { res = accountManager.authenticate(req); } catch (AccountException e) { result.success = false; callback.onSuccess(result); return; } result.success = true; result.isNew = res.isNew(); try { webSession.get().login(res, false); } catch (OrmException e) { result.success = false; callback.onSuccess(result); return; } callback.onSuccess(result); }

Target:
public void authenticate(String username, final String password, final AsyncCallback<LoginResult> callback) { LoginResult result = new LoginResult(); if (username == null || "".equals(username.trim()) || password == null || "".equals(password)) { result.success = false; callback.onSuccess(result); return; } username = username.trim(); final AuthRequest req = AuthRequest.forUser(username); req.setPassword(password); final AuthResult res; try { res = accountManager.authenticate(req); } catch (AccountException e) { result.success = false; callback.onSuccess(result); return; } result.success = true; result.isNew = res.isNew(); try { webSession.get().login(res, false); } catch (OrmException e) { log.error("Unable to log in", e); result.success = false; callback.onSuccess(result); return; } callback.onSuccess(result); }
Source:
private Guid createVmCheckpoint() { if (isBackupContainsRawDisksOnly()) { return null; } final VmCheckpoint vmCheckpoint = new VmCheckpoint(); vmCheckpoint.setId(Guid.newGuid()); vmCheckpoint.setParentId(getParameters().getVmBackup().getFromCheckpointId()); vmCheckpoint.setVmId(getParameters().getVmBackup().getVmId()); vmCheckpoint.setCreationDate(new Date()); final List<VmCheckpoint> checkpoints = vmCheckpointDao.getAllForVm(getVmId()); if (!checkpoints.isEmpty()) { vmCheckpoint.setParentId(checkpoints.get(checkpoints.size() - 1).getId()); } TransactionSupport.executeInNewTransaction(() -> { vmCheckpointDao.save(vmCheckpoint); getParameters().getVmBackup().getDisks().stream() .filter(DiskImage::isQcowFormat) .forEach(disk -> vmCheckpointDao.addDiskToCheckpoint(vmCheckpoint.getId(), disk.getId())); return null; }); persistCommandIfNeeded(); return vmCheckpoint.getId(); }

Target:
private Guid createVmCheckpoint() { final VmCheckpoint vmCheckpoint = new VmCheckpoint(); vmCheckpoint.setId(Guid.newGuid()); vmCheckpoint.setParentId(getParameters().getVmBackup().getFromCheckpointId()); vmCheckpoint.setVmId(getParameters().getVmBackup().getVmId()); vmCheckpoint.setCreationDate(new Date()); final List<VmCheckpoint> checkpoints = vmCheckpointDao.getAllForVm(getVmId()); if (!checkpoints.isEmpty()) { vmCheckpoint.setParentId(checkpoints.get(checkpoints.size() - 1).getId()); } TransactionSupport.executeInNewTransaction(() -> { vmCheckpointDao.save(vmCheckpoint); getParameters().getVmBackup().getDisks().stream() .filter(DiskImage::isQcowFormat) .forEach(disk -> vmCheckpointDao.addDiskToCheckpoint(vmCheckpoint.getId(), disk.getId())); return null; }); persistCommandIfNeeded(); return vmCheckpoint.getId(); }
Source:
public ExternalServerExposerStrategyProvider( @Named("che.infra.kubernetes.server_strategy") String strategy, Map<String, ExternalServerExposerStrategy> strategies) { final ExternalServerExposerStrategy externalServerExposerStrategy = strategies.get(strategy); if (externalServerExposerStrategy != null) { this.externalServerExposerStrategy = externalServerExposerStrategy; } else { throw new IllegalArgumentException( format("Unsupported Ingress strategy '%s' configured", strategy)); } }

Target:
public ExternalServerExposerStrategyProvider( @Named("che.infra.kubernetes.server_strategy") String strategy, Map<String, ExternalServerExposerStrategy> strategies) { final ExternalServerExposerStrategy externalServerExposerStrategy = strategies.get(strategy); if (externalServerExposerStrategy != null) { this.externalServerExposerStrategy = externalServerExposerStrategy; } else { throw new ConfigurationException( format("Unsupported Ingress strategy '%s' configured", strategy)); } }
Source:
public synchronized long read(ByteBuffer[] dsts, int offset, int length) throws IOException { if (length == 0) return 0; long returnValue = 0; long readBytes; long totalLength = 0; int remains; boolean bufferAvailable = false; int limit = offset + length; for (int i = offset; i < limit; i++) { remains = dsts[i].remaining(); if (remains > 0) { bufferAvailable = true; totalLength += remains; } else if (!bufferAvailable) { offset += 1; } if (totalLength > maxRemoteSize && totalLength > size()) break; } if (offset == length) return 0; totalLength = getMaxRead(remoteOffset, totalLength); readBytes = startRead(remoteOffset, totalLength, dsts[offset++], true); if (readBytes == -1) return -1; returnValue += readBytes; for (int i = offset; i < length; i++) { while (dsts[i].hasRemaining()) { readBytes = readMore(dsts[i]); if (readBytes == -1) break; returnValue += readBytes; } } remoteOffset += returnValue; return returnValue; }

Target:
public synchronized long read(ByteBuffer[] dsts, int offset, int length) throws IOException { if (length == 0) return 0; long returnValue = 0; long readBytes; long totalLength = 0; int remains; boolean bufferAvailable = false; int limit = offset + length; for (int i = offset; i < limit; i++) { remains = dsts[i].remaining(); if (remains > 0) { bufferAvailable = true; totalLength += remains; } else if (!bufferAvailable) { offset += 1; } if (totalLength > maxRemoteSize && totalLength > size()) break; } if (!bufferAvailable) return 0; totalLength = getMaxRead(remoteOffset, totalLength); readBytes = startRead(remoteOffset, totalLength, dsts[offset++], true); if (readBytes == -1) return -1; returnValue += readBytes; for (int i = offset; i < length; i++) { while (dsts[i].hasRemaining()) { readBytes = readMore(dsts[i]); if (readBytes == -1) break; returnValue += readBytes; } } remoteOffset += returnValue; return returnValue; }
Source:
public void visitMethodDeclaration(MethodDeclarationTree tree) { if (tree.body().is(Kind.BLOCK) && !(hasValuableBody((BlockTree) tree.body()) || isClassAbstract(tree))) { context().newIssue(this, tree, MESSAGE); } super.visitMethodDeclaration(tree); }

Target:
public void visitMethodDeclaration(MethodDeclarationTree tree) { if (tree.body().is(Kind.BLOCK) && !(hasValuableBody((BlockTree) tree.body()) || isClassAbstract(tree) || hasCommentAbove(tree.modifiers().get(0)))) { commitIssue(tree, "method"); } super.visitMethodDeclaration(tree); }
Source:
public Response add(Step step) { validateParameters(step, "type", "status.state" , "description"); String id; if (step.isSetParentStep() && step.getParentStep().getId() != null) { id = step.getParentStep().getId(); } else { id = jobId.toString(); } return performCreate(VdcActionType.AddExternalStep, new AddExternalStepParameters(asGuid(id), step.getDescription(),StepMapper.map(StepEnum.fromValue(step.getType())), JobMapper.map(step.getStatus(), null)), new QueryIdResolver<Guid>(VdcQueryType.GetStepByStepId, IdQueryParameters.class)); }

Target:
public Response add(Step step) { validateParameters(step, "type", "status.state" , "description"); String id; if (step.isSetParentStep()) { validateParameters(step, "step.parentStep.id"); id = step.getParentStep().getId(); } else { id = jobId.toString(); } return performCreate(VdcActionType.AddExternalStep, new AddExternalStepParameters(asGuid(id), step.getDescription(),StepMapper.map(StepEnum.fromValue(step.getType())), JobMapper.map(step.getStatus(), null)), new QueryIdResolver<Guid>(VdcQueryType.GetStepByStepId, IdQueryParameters.class)); }
Source:
public void setResponsesObject(Responses responsesObject) { this.responsesObject = responsesObject; if (responses == null && responsesObject != null) { responses = new LinkedHashMap<String, Response>(); for (String key : this.responsesObject.keySet()) { responses.put(key, responsesObject.get(key)); } } }

Target:
public void setResponsesObject(Responses responsesObject) { this.responsesObject = responsesObject; }