auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void testDirtySaveModelOnModifyChildWithoutIndividualTracking() throws ECPProjectWithNameExistsException { final ECPProperties ecpProperties = ECPUtil.createProperties(); ecpProperties.addProperty(WorkspaceProvider.PROP_ROOT_URI, WorkspaceProvider.VIRTUAL_ROOT_URI); ecpProperties.addProperty(WorkspaceProvider.TRACK_MODIFY_ON_RESOURCE, Boolean.toString(true)); ecpProperties.removeProperty(WorkspaceProvider.TRACK_MODIFY_ON_RESOURCE); final InternalProject project2 = (InternalProject) getProjectManager().createProject(getProvider(), "Projekt " + UUID.randomUUID(), ecpProperties); final EClass clazz = EcoreFactory.eINSTANCE.createEClass(); project.getContents().add(clazz); final EClass clazz2 = EcoreFactory.eINSTANCE.createEClass(); project2.getContents().add(clazz2); assertTrue(project.hasDirtyContents()); assertFalse(project2.hasDirtyContents()); project.saveContents(); assertFalse(project.hasDirtyContents()); }

Target:
public void testDirtySaveModelOnModifyChildWithoutIndividualTracking() throws ECPProjectWithNameExistsException { final ECPProperties ecpProperties = ECPUtil.createProperties(); ecpProperties.addProperty(WorkspaceProvider.PROP_ROOT_URI, WorkspaceProvider.VIRTUAL_ROOT_URI); final InternalProject project2 = (InternalProject) getProjectManager().createProject(getProvider(), "Projekt " + UUID.randomUUID(), ecpProperties); final EClass clazz = EcoreFactory.eINSTANCE.createEClass(); project.getContents().add(clazz); final EClass clazz2 = EcoreFactory.eINSTANCE.createEClass(); project2.getContents().add(clazz2); assertTrue(project.hasDirtyContents()); assertFalse(project2.hasDirtyContents()); project.saveContents(); assertFalse(project.hasDirtyContents()); }
Source:
private static ReaderTagList parseTags(JSONObject jsonObject, String name, ReaderTagType topicType) { ReaderTagList topics = new ReaderTagList(); if (jsonObject == null) { return topics; } JSONObject jsonTopics = jsonObject.optJSONObject(name); if (jsonTopics == null) { return topics; } Iterator<String> it = jsonTopics.keys(); while (it.hasNext()) { String internalName = it.next(); JSONObject jsonTopic = jsonTopics.optJSONObject(internalName); if (jsonTopic != null) { String tagTitle = JSONUtils.getStringDecoded(jsonTopic, "title"); String tagName; if (jsonTopic.has("display_name")) { tagName = JSONUtils.getStringDecoded(jsonTopic, "display_name"); } else { tagName = tagTitle; } String endpoint = JSONUtils.getString(jsonTopic, "URL"); topics.add(new ReaderTag(tagName, tagTitle, endpoint, topicType)); } } return topics; }

Target:
private static ReaderTagList parseTags(JSONObject jsonObject, String name, ReaderTagType topicType) { ReaderTagList topics = new ReaderTagList(); if (jsonObject == null) { return topics; } JSONObject jsonTopics = jsonObject.optJSONObject(name); if (jsonTopics == null) { return topics; } Iterator<String> it = jsonTopics.keys(); while (it.hasNext()) { String internalName = it.next(); JSONObject jsonTopic = jsonTopics.optJSONObject(internalName); if (jsonTopic != null) { String tagTitle = JSONUtils.getStringDecoded(jsonTopic, "title"); String tagSlug; if (jsonTopic.has("slug")) { tagSlug = JSONUtils.getStringDecoded(jsonTopic, "slug"); } else { tagSlug = tagTitle; } String endpoint = JSONUtils.getString(jsonTopic, "URL"); topics.add(new ReaderTag(tagSlug, tagTitle, endpoint, topicType)); } } return topics; }
Source:
public Iterable<T> fetchAll(long projectId) throws IOException; public T fetch(long id) throws IOException; public void store(T item, User user) throws IOException; public String groupName(); public String idName(); } public static File getBarcodeFileLocation(HttpSession session) { return new File(session.getServletContext().getRealPath("/temp/")); }

Target:
public Iterable<T> fetchAll(long projectId) throws IOException; public T fetch(long id) throws IOException; public void store(T item) throws IOException; public String getGroupName(); public String getIdName(); } public static File getBarcodeFileLocation(HttpSession session) { return new File(session.getServletContext().getRealPath("/temp/")); }
Source:
public void testReparentingToGrandparent() { RulesetModel child = rm.addRuleset("child", rootId, id1); RulesetModel grandchild = rm.addRuleset("grandchild", id1, id2); assertEquals(id1, grandchild.getParentRulesetId()); rm.removeRuleset(id1); assertEquals(rootId, grandchild.getParentRulesetId()); }

Target:
public void testReparentingToGrandparent() { rm.addRuleset("child", rootId, id1); RulesetModel grandchild = rm.addRuleset("grandchild", id1, id2); assertEquals(id1, grandchild.getParentRulesetId()); rm.removeRuleset(id1); assertEquals(rootId, grandchild.getParentRulesetId()); }
Source:
public RichMember call(ApiCaller ac, Deserializer params) throws PerunException { ac.stateChangingCheck(); String guestName = params.readString("guestName"); String password = params.readString("password"); Vo vo = ac.getVoById(params.readInt("vo")); String namespace = params.readString("namespace"); User sponsor; try { sponsor = ac.getUserById(params.readInt("sponsor")); } catch (RpcException exp) { sponsor = null; } return ac.getMembersManager().createSponsoredMember(ac.getSession(), vo, namespace, guestName, password, sponsor); }

Target:
public RichMember call(ApiCaller ac, Deserializer params) throws PerunException { ac.stateChangingCheck(); String guestName = params.readString("guestName"); String password = params.readString("password"); Vo vo = ac.getVoById(params.readInt("vo")); String namespace = params.readString("namespace"); User sponsor = null; if(params.contains("sponsor")) { sponsor = ac.getUserById(params.readInt("sponsor")); } return ac.getMembersManager().createSponsoredMember(ac.getSession(), vo, namespace, guestName, password, sponsor); }
Source:
public void startSettingsFromHomeScreen() throws UiObjectNotFoundException { mDevice.pressHome(); final String launcherPackage = getLauncherPackageName(); assertThat(launcherPackage, notNullValue()); mDevice.wait(Until.hasObject(By.pkg(launcherPackage).depth(0)), LAUNCH_TIMEOUT); Context context = InstrumentationRegistry.getContext(); final Intent intent = context.getPackageManager() .getLaunchIntentForPackage(ANDROID_SETTINGS_PACKAGE); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); context.startActivity(intent); clickByText("Data usage"); }

Target:
public void startSettingsFromHomeScreen() throws UiObjectNotFoundException { mDevice.pressHome(); final String launcherPackage = getLauncherPackageName(); assertThat(launcherPackage, notNullValue()); mDevice.wait(Until.hasObject(By.pkg(launcherPackage).depth(0)), LAUNCH_TIMEOUT); Context context = InstrumentationRegistry.getContext(); final Intent intent = context.getPackageManager() .getLaunchIntentForPackage(ANDROID_SETTINGS_PACKAGE); intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TASK); context.startActivity(intent); clickByText(SETTINGS_DATA_USAGE_OPTION); }
Source:
public AssociationLnListTypeDto execute(final ClientConnection conn, final DlmsDevice device, final Void object) throws ProtocolAdapterException { final AttributeAddress attributeAddress = new AttributeAddress(CLASS_ID, OBIS_CODE, ATTRIBUTE_ID); LOGGER.debug("Retrieving Association LN objects for class id: {}, obis code: {}, attribute id: {}", CLASS_ID, OBIS_CODE, ATTRIBUTE_ID); List<GetResult> getResultList; try { getResultList = conn.get(attributeAddress); } catch (IOException | TimeoutException e) { throw new ConnectionException(e); } if (getResultList.isEmpty()) { throw new ProtocolAdapterException("No GetResult received while retrieving Association LN objects."); } if (getResultList.size() > 1 || getResultList.get(0) == null) { throw new ProtocolAdapterException("Expected 1 GetResult while retrieving Association LN objects, got " + getResultList.size()); } final DataObject resultData = getResultList.get(0).resultData(); if (!resultData.isComplex()) { throw new ProtocolAdapterException("Unexpected type of element"); } @SuppressWarnings("unchecked") final List<AssociationLnListElementDto> elements = this .convertAssociationLnList((List<DataObject>) getResultList.get(0).resultData().value()); return new AssociationLnListTypeDto(elements); }

Target:
public AssociationLnListTypeDto execute(final ClientConnection conn, final DlmsDevice device, final Void object) throws ProtocolAdapterException { final AttributeAddress attributeAddress = new AttributeAddress(CLASS_ID, OBIS_CODE, ATTRIBUTE_ID); LOGGER.debug("Retrieving Association LN objects for class id: {}, obis code: {}, attribute id: {}", CLASS_ID, OBIS_CODE, ATTRIBUTE_ID); final List<GetResult> getResultList = this.dlmsHelperService.getAndCheck(conn, device, "Association LN Objects", attributeAddress); final DataObject resultData = getResultList.get(0).resultData(); if (!resultData.isComplex()) { throw new ProtocolAdapterException("Unexpected type of element"); } @SuppressWarnings("unchecked") final List<AssociationLnListElementDto> elements = this .convertAssociationLnList((List<DataObject>) getResultList.get(0).resultData().value()); return new AssociationLnListTypeDto(elements); }
Source:
private void sendEvent() { try { httpJsonRequestFactory.fromUrl(apiEndpoint + "/workspace/" + WorkspaceIdProvider.getWorkspaceId() + "/runtime") .useDeleteMethod() .request(); LOG.info("Workspace " + WorkspaceIdProvider.getWorkspaceId() + " has been stopped."); } catch (Exception e) { LOG.error("Cannot stop workspace " + WorkspaceIdProvider.getWorkspaceId(), e); } finally { stopped.set(true); } }

Target:
private void sendEvent() { try { httpJsonRequestFactory.fromUrl(apiEndpoint + "/workspace/" + WorkspaceIdProvider.getWorkspaceId() + "/runtime") .useDeleteMethod() .request(); LOG.info("Stopping workspace " + WorkspaceIdProvider.getWorkspaceId() + " after " + timeout / 1000 + " seconds of inactivity."); } catch (Exception e) { LOG.error("Cannot stop workspace " + WorkspaceIdProvider.getWorkspaceId(), e); } finally { stopped.set(true); } }
Source:
public FederatedZkClient(RealmAwareZkClient.RealmAwareZkConnectionConfig connectionConfig, RealmAwareZkClient.RealmAwareZkClientConfig clientConfig) throws IOException, InvalidRoutingDataException { if (connectionConfig == null) { throw new IllegalArgumentException("RealmAwareZkConnectionConfig cannot be null!"); } if (clientConfig == null) { throw new IllegalArgumentException("RealmAwareZkConnectionConfig cannot be null!"); } String msdsEndpoint = connectionConfig.getMsdsEndpoint(); if (msdsEndpoint == null || msdsEndpoint.isEmpty()) { _metadataStoreRoutingData = HttpRoutingDataReader.getMetadataStoreRoutingData(); } else { _metadataStoreRoutingData = HttpRoutingDataReader.getMetadataStoreRoutingData(msdsEndpoint); } _isClosed = false; _clientConfig = clientConfig; _pathBasedZkSerializer = clientConfig.getZkSerializer(); _zkRealmToZkClientMap = new ConcurrentHashMap<>(); }

Target:
public FederatedZkClient(RealmAwareZkClient.RealmAwareZkConnectionConfig connectionConfig, RealmAwareZkClient.RealmAwareZkClientConfig clientConfig) throws IOException, InvalidRoutingDataException { if (connectionConfig == null) { throw new IllegalArgumentException("RealmAwareZkConnectionConfig cannot be null!"); } if (clientConfig == null) { throw new IllegalArgumentException("RealmAwareZkClientConfig cannot be null!"); } String msdsEndpoint = connectionConfig.getMsdsEndpoint(); if (msdsEndpoint == null || msdsEndpoint.isEmpty()) { _metadataStoreRoutingData = HttpRoutingDataReader.getMetadataStoreRoutingData(); } else { _metadataStoreRoutingData = HttpRoutingDataReader.getMetadataStoreRoutingData(msdsEndpoint); } _isClosed = false; _clientConfig = clientConfig; _pathBasedZkSerializer = clientConfig.getZkSerializer(); _zkRealmToZkClientMap = new ConcurrentHashMap<>(); }
Source:
public List<ValidationProvider<?>> run() { ClassLoader classloader = Thread.currentThread().getContextClassLoader(); List<ValidationProvider<?>> cachedContextClassLoaderProviderList = getCachedValidationProviders( classloader ); if ( cachedContextClassLoaderProviderList != null ) { return cachedContextClassLoaderProviderList; } ServiceLoader<ValidationProvider> loader = ServiceLoader.load( ValidationProvider.class, classloader ); Iterator<ValidationProvider> providerIterator = loader.iterator(); if ( !providerIterator.hasNext() ) { classloader = DefaultValidationProviderResolver.class.getClassLoader(); List<ValidationProvider<?>> cachedCurrentClassLoaderProviderList = getCachedValidationProviders( classloader ); if ( cachedCurrentClassLoaderProviderList != null ) { return cachedCurrentClassLoaderProviderList; } loader = ServiceLoader.load( ValidationProvider.class, classloader ); providerIterator = loader.iterator(); } List<ValidationProvider<?>> validationProviderList = new ArrayList<ValidationProvider<?>>(); while ( providerIterator.hasNext() ) { try { validationProviderList.add( providerIterator.next() ); } catch ( ServiceConfigurationError e ) { throw new ValidationException( "Unable to load Bean Validation provider non.existent.ValidationProvider", e ); } } cacheValidationProviders( classloader, validationProviderList ); return validationProviderList; }

Target:
public List<ValidationProvider<?>> run() { ClassLoader classloader = Thread.currentThread().getContextClassLoader(); List<ValidationProvider<?>> cachedContextClassLoaderProviderList = getCachedValidationProviders( classloader ); if ( cachedContextClassLoaderProviderList != null ) { return cachedContextClassLoaderProviderList; } ServiceLoader<ValidationProvider> loader = ServiceLoader.load( ValidationProvider.class, classloader ); Iterator<ValidationProvider> providerIterator = loader.iterator(); if ( !providerIterator.hasNext() ) { classloader = DefaultValidationProviderResolver.class.getClassLoader(); List<ValidationProvider<?>> cachedCurrentClassLoaderProviderList = getCachedValidationProviders( classloader ); if ( cachedCurrentClassLoaderProviderList != null ) { return cachedCurrentClassLoaderProviderList; } loader = ServiceLoader.load( ValidationProvider.class, classloader ); providerIterator = loader.iterator(); } List<ValidationProvider<?>> validationProviderList = new ArrayList<ValidationProvider<?>>(); while ( providerIterator.hasNext() ) { try { validationProviderList.add( providerIterator.next() ); } catch ( ServiceConfigurationError e ) { throw new ValidationException( "Unable to load Bean Validation provider", e ); } } cacheValidationProviders( classloader, validationProviderList ); return validationProviderList; }
Source:
public void onStreamCreate(IMediaStream stream) { WMSProperties properties = stream.getProperties(); RTPStream rtpSession = stream.getRTPStream(); String streamName = (stream.getName() != null && stream.getName().length() > 0) ? stream.getName() : stream.getContextStr(); IClient client = stream.getClient(); PacketListener listener = new PacketListener(); WMSProperties props = stream.getProperties(); synchronized (props) { props.setProperty(Constants.STREAM_ACTION_LISTENER_PROPERTY, listener); } stream.addLivePacketListener(listener); }

Target:
public void onStreamCreate(IMediaStream stream) { PacketListener listener = new PacketListener(); WMSProperties props = stream.getProperties(); synchronized (props) { props.setProperty(Constants.STREAM_ACTION_LISTENER_PROPERTY, listener); } stream.addLivePacketListener(listener); }
Source:
public void verifyTemplateWasFound() { waitForElementVisibleByElement(templatesBox); waitForElementByElement(thumbCollection.get(0)); System.out.println(thumbCollection.get(0)); System.out.println(checkIfElementOnPage(thumbCollection.get(0))); Assertion.assertEquals(checkIfElementOnPage(thumbCollection.get(0)), true); }

Target:
public void verifyTemplateWasFound() { waitForElementVisibleByElement(templatesBox); waitForElementByElement(thumbCollection.get(0)); Assertion.assertEquals(checkIfElementOnPage(thumbCollection.get(0)), true); }
Source:
private void bindView() { setContentView(R.layout.activity_home); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); View mainView = findViewById(R.id.home_layout); mPager = (HomeViewPager)findViewById(R.id.view_pager); mPager.setAdapter(new HomeSlidePagerAdapter(getSupportFragmentManager(), this)); mSlidingTabLayout= (PagerSlidingTabStrip) findViewById(R.id.sliding_tabs); mSlidingTabLayout.setViewPager(mPager); ViewCompat.setElevation(toolbar, getResources().getDimension(R.dimen.toolbar_elevation)); ViewCompat.setElevation(mSlidingTabLayout, getResources().getDimension(R.dimen.toolbar_elevation)); mainView.setOnClickListener(new View.OnClickListener() { @Override public void onClick(View view) { Intent contactIntent = new Intent(Intent.ACTION_PICK, ContactsContract.Contacts.CONTENT_URI); startActivityForResult(contactIntent, REQUEST_CONTACTPICKER); } }); }

Target:
private void bindView() { setContentView(R.layout.activity_home); Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar); setSupportActionBar(toolbar); mPager = (HomeViewPager) findViewById(R.id.view_pager); mPager.setAdapter(new HomeSlidePagerAdapter(getSupportFragmentManager(), this)); mSlidingTabLayout = (PagerSlidingTabStrip) findViewById(R.id.sliding_tabs); mSlidingTabLayout.setViewPager(mPager); ViewCompat.setElevation(toolbar, getResources().getDimension(R.dimen.toolbar_elevation)); ViewCompat.setElevation(mSlidingTabLayout, getResources().getDimension(R.dimen.toolbar_elevation)); }
Source:
CorsConfigurationAccessor(ResourceMappings mappings, Repositories repositories, StringValueResolver embeddedValueResolver) { this.mappings = mappings; this.repositories = repositories; this.embeddedValueResolver = embeddedValueResolver; }

Target:
CorsConfigurationAccessor(ResourceMappings mappings, Repositories repositories, StringValueResolver embeddedValueResolver) { Assert.notNull(mappings, "ResourceMappings must not be null!"); Assert.notNull(repositories, "Repositories must not be null!"); this.mappings = mappings; this.repositories = repositories; this.embeddedValueResolver = embeddedValueResolver; }
Source:
public static boolean canProcess(IArtifactDescriptor descriptor) { IExtensionRegistry registry = RegistryFactory.getRegistry(); IExtensionPoint point = registry.getExtensionPoint(PROCESSING_STEPS_EXTENSION_ID); if (point == null) return false; List<String> processorIds = stream(descriptor.getProcessingSteps()) .map(IProcessingStepDescriptor::getProcessorId) .collect(toList()); try { for (String processorId : processorIds) { IExtension extension = point.getExtension(processorId); if (extension == null) return false; List<IConfigurationElement> stepConfigs = stream(extension.getConfigurationElements()) .filter(config -> "step".equals(config.getName())) .collect(toList()); if (stepConfigs.size() != 1) return false; IConfigurationElement stepConfig = stepConfigs.get(0); ProcessingStep stepToCheck = (ProcessingStep) stepConfig.createExecutableExtension("class"); if (!stepToCheck.isEnabled()) return false; } } catch (InvalidRegistryObjectException e) { LogHelper.log(new Status(IStatus.WARNING, Activator.ID, "", e)); return false; } catch (CoreException e) { return false; } return true; }

Target:
public static boolean canProcess(IArtifactDescriptor descriptor) { IExtensionPoint point = ofNullable(RegistryFactory.getRegistry()) .map(r -> r.getExtensionPoint(PROCESSING_STEPS_EXTENSION_ID)) .orElse(null); if (point == null) return false; List<String> processorIds = stream(descriptor.getProcessingSteps()) .map(IProcessingStepDescriptor::getProcessorId) .collect(toList()); try { for (String processorId : processorIds) { IExtension extension = point.getExtension(processorId); if (extension == null) return false; List<IConfigurationElement> stepConfigs = stream(extension.getConfigurationElements()) .filter(config -> "step".equals(config.getName())) .collect(toList()); if (stepConfigs.size() != 1) return false; IConfigurationElement stepConfig = stepConfigs.get(0); ProcessingStep stepToCheck = (ProcessingStep) stepConfig.createExecutableExtension("class"); if (!stepToCheck.isEnabled()) return false; } } catch (InvalidRegistryObjectException e) { LogHelper.log(new Status(IStatus.WARNING, Activator.ID, "", e)); return false; } catch (CoreException e) { return false; } return true; }
Source:
private List<Map<String, Object>> parseHostDevices(XmlDocument document, List<VmDevice> devices, Guid hostId) { List<VmDevice> dbDevices= filterDevices(devices, VmDeviceGeneralType.HOSTDEV); if (dbDevices.isEmpty()) { Collections.emptyList(); } Map<Map<String, String>, HostDevice> addressToHostDevice = hostDeviceDao.getHostDevicesByHostId(hostId) .stream() .filter(dev -> !dev.getAddress().isEmpty()) .collect(Collectors.toMap(HostDevice::getAddress, device -> device)); List<Map<String, Object>> result = new ArrayList<>(); for (XmlNode node : document.selectNodes(" Map<String, String> hostAddress = parseHostAddress(node); if (hostAddress == null) { continue; } HostDevice hostDevice = addressToHostDevice.get(hostAddress); Map<String, Object> dev = new HashMap<>(); dev.put(VdsProperties.Type, VmDeviceGeneralType.HOSTDEV.getValue()); dev.put(VdsProperties.Address, parseAddress(node)); dev.put(VdsProperties.Alias, parseAlias(node)); dev.put(VdsProperties.Device, hostDevice.getDeviceName()); VmDevice dbDev = dbDevices.stream() .filter(d -> d.getDevice().equals(hostDevice.getDeviceName())) .findFirst() .orElse(null); if (dbDev == null) { log.warn("VM host device '{}' does not exist in the database, thus ignored", hostDevice.getDeviceName()); continue; } dev.put(VdsProperties.DeviceId, dbDev.getId().getDeviceId().toString()); dev.put(VdsProperties.SpecParams, dbDev.getSpecParams()); result.add(dev); } return result; }

Target:
private List<Map<String, Object>> parseHostDevices(XmlDocument document, List<VmDevice> devices, Guid hostId) { List<VmDevice> dbDevices = filterDevices(devices, VmDeviceGeneralType.HOSTDEV); if (dbDevices.isEmpty()) { return Collections.emptyList(); } Map<Map<String, String>, HostDevice> addressToHostDevice = hostDeviceDao.getHostDevicesByHostId(hostId) .stream() .filter(dev -> !dev.getAddress().isEmpty()) .collect(Collectors.toMap(HostDevice::getAddress, device -> device)); List<Map<String, Object>> result = new ArrayList<>(); for (XmlNode node : document.selectNodes(" Map<String, String> hostAddress = parseHostAddress(node); if (hostAddress == null) { continue; } HostDevice hostDevice = addressToHostDevice.get(hostAddress); Map<String, Object> dev = new HashMap<>(); dev.put(VdsProperties.Type, VmDeviceGeneralType.HOSTDEV.getValue()); dev.put(VdsProperties.Address, parseAddress(node)); dev.put(VdsProperties.Alias, parseAlias(node)); dev.put(VdsProperties.Device, hostDevice.getDeviceName()); VmDevice dbDev = dbDevices.stream() .filter(d -> d.getDevice().equals(hostDevice.getDeviceName())) .findFirst() .orElse(null); if (dbDev == null) { log.warn("VM host device '{}' does not exist in the database, thus ignored", hostDevice.getDeviceName()); continue; } dev.put(VdsProperties.DeviceId, dbDev.getId().getDeviceId().toString()); dev.put(VdsProperties.SpecParams, dbDev.getSpecParams()); result.add(dev); } return result; }
Source:
private List<String> getList(String strProtocol, boolean mandatory) { List<String> rtnList = new ArrayList<String>(); loadProperties(); if (prop != null) { String strKey = strProtocol; if (mandatory) { strKey += ".mandatory"; } else { strKey += ".optional"; } String strLength = prop.getProperty(strKey); Integer iLength = null; if (strLength != null) { try { iLength = Integer.parseInt(strLength); } catch (Exception e) { iLength = null; } } if (iLength != null) { for (int i = 1; i <= iLength; i++) { String tmpString = strKey + "." + i; String strVal = prop.getProperty(tmpString); if (strVal != null) { if (strProtocol.equals(InboundClientConstants.TYPE_KAFKA) && (mandatory && !strVal.contains("highlevel.") && !strVal.contains("simple.")) || !mandatory) { rtnList.add(strVal); } else if(!strProtocol.equals(InboundClientConstants.TYPE_KAFKA)) { rtnList.add(strVal); } } } } } return rtnList; }

Target:
private List<String> getList(String strProtocol, boolean mandatory) { List<String> rtnList = new ArrayList<String>(); loadProperties(); if (prop != null) { String strKey = strProtocol; if (mandatory) { strKey += ".mandatory"; } else { strKey += ".optional"; } String strLength = prop.getProperty(strKey); Integer iLength = null; if (strLength != null) { try { iLength = Integer.parseInt(strLength); } catch (Exception e) { iLength = null; } } if (iLength != null) { for (int i = 1; i <= iLength; i++) { String tmpString = strKey + "." + i; String strVal = prop.getProperty(tmpString); if (strVal != null) { if ((strProtocol.equals(InboundClientConstants.TYPE_KAFKA) && ((mandatory && !strVal.contains("highlevel.") && !strVal.contains("simple.")) || !mandatory)) || !strProtocol.equals(InboundClientConstants.TYPE_KAFKA)) { rtnList.add(strVal); } } } } } return rtnList; }
Source:
private boolean checkReferer( final HttpServletRequest request, final MapPrinter mapPrinter) { final Configuration config = mapPrinter.getConfiguration(); final UriMatchers allowedReferers = config.getAllowedReferersImpl(); if (allowedReferers == null) { return true; } final String referer = request.getHeader("referer"); if (referer == null) { LOGGER.debug("Null referer"); return false; } try { return allowedReferers.matches(new URI(referer), HttpMethod.resolve(request.getMethod())); } catch (SocketException | UnknownHostException | URISyntaxException | MalformedURLException e) { LOGGER.error("Referer invalid", referer, e); return false; } }

Target:
private boolean checkReferer( final HttpServletRequest request, final MapPrinter mapPrinter) { final Configuration config = mapPrinter.getConfiguration(); final UriMatchers allowedReferers = config.getAllowedReferersImpl(); if (allowedReferers == null) { return true; } String referer = request.getHeader("referer"); if (referer == null) { referer = "http://localhost/"; } try { return allowedReferers.matches(new URI(referer), HttpMethod.resolve(request.getMethod())); } catch (SocketException | UnknownHostException | URISyntaxException | MalformedURLException e) { LOGGER.error("Referer invalid", referer, e); return false; } }
Source:
private void readPaint(String paint) { try { String parts[] = paint.split(borderSeparator); useGradient = parts[0].contains(gradientSeparator); if (useGradient) { String gradientParts[] = parts[0].split(gradientSeparator); color1 = Color.valueOf(gradientParts[0]); color2 = Color.valueOf(gradientParts[1]); x0 = Float.parseFloat(gradientParts[2]); y0 = Float.parseFloat(gradientParts[3]); float x1 = Float.parseFloat(gradientParts[4]); float y1 = Float.parseFloat(gradientParts[5]); gradientVector = new Vector2(x1 - x0, y1 - y0); gradientLength = gradientVector.len(); } else { color1 = Color.valueOf(parts[0]); } hasBorder = parts.length > 1; if (hasBorder) { borderColor = Color.valueOf(parts[1]); } } catch (Exception e) { hasBorder = false; Gdx.app.error("ShapeFactory", "Invalid paint " + paint, e); } }

Target:
private void readPaint(String paint) { try { String parts[] = paint.split(borderSeparator); useGradient = parts[0].contains(gradientSeparator); if (useGradient) { String gradientParts[] = parts[0].split(gradientSeparator); color1 = Color.valueOf(gradientParts[0]); color2 = Color.valueOf(gradientParts[1]); x0 = Float.parseFloat(gradientParts[2]); y0 = Float.parseFloat(gradientParts[3]); float x1 = Float.parseFloat(gradientParts[4]); float y1 = Float.parseFloat(gradientParts[5]); gradientVector = new Vector2(x1 - x0, y1 - y0); gradientLength = gradientVector.len(); } else { color1 = Color.valueOf(parts[0]); } hasBorder = parts.length > 1; if (hasBorder) { borderColor = Color.valueOf(parts[1]); } } catch (Exception e) { hasBorder = false; useGradient = false; color1 = Color.PINK; Gdx.app.error("ShapeFactory", "Invalid paint " + paint + ". Paint set to pink.", e); } }
Source:
public void render(Node node) { if (node instanceof TaskListItemMarker) { Map<String, String> attributes = context.extendAttributes(node, "input", Collections.<String, String>emptyMap()); attributes.put("type", "checkbox"); attributes.put("disabled", ""); if (((TaskListItemMarker) node).isChecked()) { attributes.put("checked", ""); } html.tag("input", attributes); html.text(" "); renderChildren(node); } }

Target:
public void render(Node node) { if (node instanceof TaskListItemMarker) { Map<String, String> attributes = new LinkedHashMap<>(); attributes.put("type", "checkbox"); attributes.put("disabled", ""); if (((TaskListItemMarker) node).isChecked()) { attributes.put("checked", ""); } html.tag("input", context.extendAttributes(node, "input", attributes)); html.text(" "); renderChildren(node); } }
Source:
private void handleInternalLink(PageTitle title) { if (!isAdded()) { return; } if (title.isSpecial()) { Utils.visitInExternalBrowser(getActivity(), Uri.parse(title.getMobileUri())); return; } if (referenceDialog != null && referenceDialog.isShowing()) { referenceDialog.dismiss(); } if (app.isProdRelease() || app.getLinkPreviewVersion() == 0) { HistoryEntry historyEntry = new HistoryEntry(title, HistoryEntry.SOURCE_INTERNAL_LINK); getPageActivity().displayNewPage(title, historyEntry); new LinkPreviewFunnel(app, title).logNavigate(); } else { LinkPreviewDialog dialog = LinkPreviewDialog.newInstance(title); dialog.setOnNavigateListener(new LinkPreviewDialog.OnNavigateListener() { @Override public void onNavigate(PageTitle title) { HistoryEntry historyEntry = new HistoryEntry(title, HistoryEntry.SOURCE_INTERNAL_LINK); ((PageActivity) getActivity()).displayNewPage(title, historyEntry); } }); dialog.show(getActivity().getSupportFragmentManager(), "link_preview_dialog"); } }

Target:
private void handleInternalLink(PageTitle title) { if (!isAdded()) { return; } if (title.isSpecial()) { Utils.visitInExternalBrowser(getActivity(), Uri.parse(title.getMobileUri())); return; } if (referenceDialog != null && referenceDialog.isShowing()) { referenceDialog.dismiss(); } if (app.isProdRelease() || app.getLinkPreviewVersion() == 0) { HistoryEntry historyEntry = new HistoryEntry(title, HistoryEntry.SOURCE_INTERNAL_LINK); getPageActivity().displayNewPage(title, historyEntry); new LinkPreviewFunnel(app, title).logNavigate(); } else { getPageActivity().showLinkPreview(title, HistoryEntry.SOURCE_INTERNAL_LINK); } }
Source:
public int run() throws IOException { int b = in.read(); if (b != -1) { mOut.write(b); size++; return 1; } else { mOut.close(); LongObjectId loid = LongObjectId .fromRaw(mOut.getMessageDigest().digest()); Path mediaFile = lfsUtil.getMediaFile(loid); if (Files.isRegularFile(mediaFile)) { long fsSize = Files.size(mediaFile); if (fsSize != size) { throw new CorruptMediaFile(mediaFile, size, fsSize); } } else { FileUtils.mkdirs(mediaFile.getParent().toFile(), true); FileUtils.rename(tmpFile.toFile(), mediaFile.toFile()); } LfsPointer lfsPointer = new LfsPointer(loid, size); lfsPointer.encode(out); out.close(); return -1; } }

Target:
public int run() throws IOException { int b = in.read(); if (b != -1) { dOut.write(b); size++; return 1; } else { dOut.close(); LongObjectId loid = LongObjectId .fromRaw(dOut.getMessageDigest().digest()); Path mediaFile = lfsUtil.getMediaFile(loid); if (Files.isRegularFile(mediaFile)) { long fsSize = Files.size(mediaFile); if (fsSize != size) { throw new CorruptMediaFile(mediaFile, size, fsSize); } } else { FileUtils.mkdirs(mediaFile.getParent().toFile(), true); FileUtils.rename(tmpFile.toFile(), mediaFile.toFile()); } LfsPointer lfsPointer = new LfsPointer(loid, size); lfsPointer.encode(out); out.close(); return -1; } }
Source:
public void process() { PerformanceMonitor.startActivity("rendering/copyImageToHMD"); displayResolutionDependentFBOs.get(new ResourceUrn("engine:sceneFinal")).bindTexture(); renderFinalStereoImage(worldRenderer.getCurrentRenderStage()); PerformanceMonitor.endActivity(); }

Target:
public void process() { PerformanceMonitor.startActivity("rendering/copyImageToHMD"); sceneFinalFbo.bindTexture(); renderFinalStereoImage(worldRenderer.getCurrentRenderStage()); PerformanceMonitor.endActivity(); }
Source:
Collection<LocationProvider> getProviders() { return this.providers; }

Target:
Collection<LocationProvider> getProviders() { return providers; }
Source:
public List<CorfuQueueRecord<E>> entryList(Long entriesAfter, int maxEntries) { if (maxEntries <= 0) { throw new IllegalArgumentException("entryList given negative maxEntries"); } if (maxEntries > MAX_INDEX_ENTRIES) { throw new IllegalArgumentException( "entryList can't return more than "+MAX_INDEX_ENTRIES+" entries" ); } long snapshotVersion; boolean startedNewTransaction = false; if (TransactionalContext.isInTransaction()) { snapshotVersion = TransactionalContext.getCurrentContext() .getSnapshotTimestamp().getSequence(); } else { runtime.getObjectsView().TXBuild().type(TransactionType.WRITE_AFTER_WRITE) .build() .begin(); snapshotVersion = TransactionalContext.getCurrentContext() .getSnapshotTimestamp().getSequence(); startedNewTransaction = true; } List<CorfuQueueRecord<E>> copy = new ArrayList<>( Math.min(corfuTable.size(), maxEntries) ); int index = 0; for (Long entryId : corfuTable.keySet().stream().sorted().collect(Collectors.toList())) { if (entryId <= entriesAfter) { continue; } if (++index >= maxEntries) { break; } long ordering = (snapshotVersion << MAX_BITS_FOR_INDEX) | index; CorfuQueueRecord<E> record = new CorfuQueueRecord<>( ordering, entryId, corfuTable.get(entryId) ); copy.add(record); } if (startedNewTransaction) { runtime.getObjectsView().TXEnd(); } return copy; }

Target:
public List<CorfuQueueRecord<E>> entryList(Long entriesAfter, int maxEntries) { if (maxEntries <= 0) { throw new IllegalArgumentException("entryList given negative maxEntries"); } if (maxEntries > MAX_INDEX_ENTRIES) { throw new IllegalArgumentException( "entryList can't return more than "+MAX_INDEX_ENTRIES+" entries" ); } long snapshotVersion; boolean startedNewTransaction = false; if (TransactionalContext.isInTransaction()) { snapshotVersion = TransactionalContext.getCurrentContext() .getSnapshotTimestamp().getSequence(); } else { runtime.getObjectsView().TXBuild().type(TransactionType.WRITE_AFTER_WRITE) .build() .begin(); snapshotVersion = TransactionalContext.getCurrentContext() .getSnapshotTimestamp().getSequence(); startedNewTransaction = true; } List<CorfuQueueRecord<E>> copy = new ArrayList<>( Math.min(corfuTable.size(), maxEntries) ); int index = 0; for (Long entryId : corfuTable.keySet().stream() .filter(e -> e > entriesAfter) .sorted().collect(Collectors.toList())) { if (++index >= maxEntries) { break; } long ordering = (snapshotVersion << MAX_BITS_FOR_INDEX) | index; CorfuQueueRecord<E> record = new CorfuQueueRecord<>( ordering, entryId, corfuTable.get(entryId) ); copy.add(record); } if (startedNewTransaction) { runtime.getObjectsView().TXEnd(); } return copy; }
Source:
public Set<FormulaVariable> getFormulaVariablesInStudy(final Integer studyId, final Integer datasetId) { final Set<Integer> variableIds = new HashSet<>(); final Integer plotDatasetId = this.daoFactory.getDmsProjectDAO().getDatasetsByTypeForStudy(studyId, DatasetTypeEnum.PLOT_DATA.getId()).get(0).getProjectId(); final List<MeasurementVariable> measurementVariables = this.daoFactory.getDmsProjectDAO().getObservationSetVariables(Arrays.asList(plotDatasetId, datasetId), Arrays .asList(VariableType.TRAIT.getId(), VariableType.ENVIRONMENT_DETAIL.getId(), VariableType.STUDY_CONDITION.getId())); for (final MeasurementVariable measurementVariable : measurementVariables) { variableIds.add(measurementVariable.getTermId()); } return this.formulaService.getAllFormulaVariables(variableIds); }

Target:
public Set<FormulaVariable> getFormulaVariablesInStudy(final Integer studyId, final Integer datasetId) { final Set<Integer> variableIds = new HashSet<>(); final Integer plotDatasetId = this.daoFactory.getDmsProjectDAO().getDatasetsByTypeForStudy(studyId, DatasetTypeEnum.PLOT_DATA.getId()).get(0).getProjectId(); final List<MeasurementVariable> measurementVariables = this.daoFactory.getDmsProjectDAO().getObservationSetVariables(Arrays.asList(plotDatasetId, datasetId), CALCULATED_VARIABLE_VARIABLE_TYPES); for (final MeasurementVariable measurementVariable : measurementVariables) { variableIds.add(measurementVariable.getTermId()); } return this.formulaService.getAllFormulaVariables(variableIds); }
Source:
public UserMessageDto(UserMessageModel userMessageModel) { this.userMessageId = userMessageModel.getMessageId(); this.title = userMessageModel.getTitle(); this.content = userMessageModel.getContent(); this.read = userMessageModel.isRead(); this.createdTime = userMessageModel.getCreatedTime(); }

Target:
public UserMessageDto(UserMessageModel userMessageModel) { this.userMessageId = userMessageModel.getMessageId(); this.title = userMessageModel.getTitle(); this.content = StringUtils.isEmpty(userMessageModel.getContent()) ? userMessageModel.getTitle() : userMessageModel.getContent(); this.read = userMessageModel.isRead(); this.createdTime = userMessageModel.getCreatedTime(); }
Source:
public <T extends IAtsObject> Collection<T> getRelated(IAtsObject atsObject, RelationTypeSide relationType, DeletionFlag flag, Class<T> clazz) { List<T> results = new ArrayList<>(); Artifact useArt = getArtifact(atsObject); if (atsObject.isInvalid()) { return results; } if (useArt != null) { for (Artifact art : useArt.getRelatedArtifacts(relationType, flag)) { IAtsObject object = AtsObjects.getAtsObject(art, atsClient); if (object != null) { results.add((T) object); } } } return results; }

Target:
public <T extends IAtsObject> Collection<T> getRelated(IAtsObject atsObject, RelationTypeSide relationType, DeletionFlag flag, Class<T> clazz) { List<T> results = new ArrayList<>(); Artifact useArt = getArtifact(atsObject); if (atsObject == null || atsObject.isInvalid()) { return results; } if (useArt != null) { for (Artifact art : useArt.getRelatedArtifacts(relationType, flag)) { IAtsObject object = AtsObjects.getAtsObject(art, atsClient); if (object != null) { results.add((T) object); } } } return results; }
Source:
protected void onInitExtras(Bundle extras) { super.onInitExtras(extras); mRepoOwner = extras.getString("owner"); mRepoName = extras.getString("repo"); mPullRequestNumber = extras.getInt("number"); mInitialCommentId = extras.getLong("initial_comment", -1); mInitialPage = extras.getInt("initial_page", -1); extras.remove("initial_comment"); extras.remove("target_screen"); }

Target:
protected void onInitExtras(Bundle extras) { super.onInitExtras(extras); mRepoOwner = extras.getString("owner"); mRepoName = extras.getString("repo"); mPullRequestNumber = extras.getInt("number"); mInitialCommentId = extras.getLong("initial_comment", -1); mInitialPage = extras.getInt("initial_page", -1); extras.remove("initial_comment"); extras.remove("initial_page"); }
Source:
private static void mkdirsOrThrow(File dir) throws IOException { if (!dir.exists()) { if (!dir.mkdirs()) { throw new IOException("Failed to create directory " + dir); } } }

Target:
private static void mkdirsOrThrow(File dir) throws IOException { if (!dir.exists() && !dir.mkdirs()) { throw new IOException("Failed to create directory " + dir); } }
Source:
private DBObject writeReplaceQuery(DBObject doc) { DBObject hidden=getHidden(doc,false); ObjectId top=null; if(hidden!=null) { List<ObjectId> list=(List<ObjectId>)hidden.get(DOCVER); if(list!=null&&!list.isEmpty()) top=list.get(0); } BasicDBObject query=new BasicDBObject("_id",doc.get("_id")); query.append(DOCVER_FLD0,top); return query; }

Target:
private DBObject writeReplaceQuery(DBObject doc) { DBObject hidden=getHidden(doc,false); ObjectId top=null; if(hidden!=null) { List<ObjectId> list=(List<ObjectId>)hidden.get(DOCVER); if(list!=null&&!list.isEmpty()) top=list.get(0); } BasicDBObject query=new BasicDBObject("_id",doc.get("_id")); if(detectConcurrencyErrors) query.append(DOCVER_FLD0,top); return query; }
Source:
public void test_ok() { JavaScriptCheckVerifier.verify(check, new File(DIR, "file_ok1.js")); JavaScriptCheckVerifier.verify(check, new File(DIR, "file_ok2.js")); JavaScriptCheckVerifier.verify(check, new File(DIR, "file_ok3.js")); JavaScriptCheckVerifier.verify(check, new File(DIR, "file_ok4.js")); JavaScriptCheckVerifier.verify(check, new File(DIR, "file_ok5.js")); JavaScriptCheckVerifier.verify(check, new File(DIR, "file_ok6.js")); }

Target:
public void test_ok() { JavaScriptCheckVerifier.verify(check, new File(DIR, "file_ok_with_bitwise_operator.js")); JavaScriptCheckVerifier.verify(check, new File(DIR, "file_ok_outside_condition.js")); JavaScriptCheckVerifier.verify(check, new File(DIR, "file_ok_with_literal.js")); JavaScriptCheckVerifier.verify(check, new File(DIR, "file_ok_several_suspicious.js")); JavaScriptCheckVerifier.verify(check, new File(DIR, "file_ok_for_init.js")); JavaScriptCheckVerifier.verify(check, new File(DIR, "file_ok_for_no_condition.js")); }
Source:
public Integer getGridSize() { Object objectValue = getValueForKey(MDS_DEFAULT_GRID_SIZE); Integer value = DEFAULT_GRID_SIZE; if (objectValue != null && StringUtils.isNotBlank(objectValue.toString())) { value = Integer.parseInt(objectValue.toString()); } return value; }

Target:
public Integer getGridSize() { if (gridSize == null) { return DEFAULT_GRID_SIZE; } return gridSize; }
Source:
private static Collection<RestClientListener> listeners() { ClassLoader threadContextClassLoader = AccessController.doPrivileged( (PrivilegedAction<ClassLoader>)() -> Thread.currentThread().getContextClassLoader()); synchronized (REST_CLIENT_LISTENERS) { return REST_CLIENT_LISTENERS.computeIfAbsent(threadContextClassLoader, key -> { Collection<RestClientListener> listeners = new ArrayList<>(); for (RestClientListener listener : ServiceLoader.load(RestClientListener.class)) { listeners.add(listener); } return listeners; }); } }

Target:
private static Collection<RestClientListener> listeners() { ClassLoader threadContextClassLoader; if (System.getSecurityManager() == null) { threadContextClassLoader = Thread.currentThread().getContextClassLoader(); } else { threadContextClassLoader = AccessController.doPrivileged( (PrivilegedAction<ClassLoader>)() -> Thread.currentThread().getContextClassLoader()); } synchronized (REST_CLIENT_LISTENERS) { return REST_CLIENT_LISTENERS.computeIfAbsent(threadContextClassLoader, key -> StreamSupport.stream(ServiceLoader.load(RestClientListener.class).spliterator(), false) .collect(Collectors.toList())); } }
Source:
public void createRollbackTxTest() { FedoraTransaction tx = repository.startTransaction(); repository.createFolderObject(pid, model); tx.cancel(); }

Target:
public void createRollbackTxTest() { FedoraTransaction tx = repository.startTransaction(); FolderObject obj = repository.createFolderObject(pid, model); tx.cancel(); assertNull(repository.getFolderObject(pid)); assertNull(obj.getUri()); assertFalse(FedoraTransaction.hasTxId()); assertFalse(FedoraTransaction.isStillAlive()); }
Source:
private void writeSubSingleBenchmarkScoreCharts() { subSingleBenchmarkAggregationChartFileMap = new HashMap<ProblemBenchmarkResult, List<File>>(); CategoryAxis xAxis = new CategoryAxis("Solver Configurations"); NumberAxis yAxis = new NumberAxis("Scores distribution of single benchmark runs"); yAxis.setAutoRangeIncludesZero(false); BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer(){ @Override public int getRowCount() { return 1; } }; renderer.setFillBox(true); renderer.setUseOutlinePaintForWhiskers(true); renderer.setMedianVisible(true); renderer.setMeanVisible(false); renderer.setItemMargin(0.0d); for (ProblemBenchmarkResult problemBenchmarkResult : plannerBenchmarkResult.getUnifiedProblemBenchmarkResultList()) { List<? extends BoxAndWhiskerCategoryDataset> datasetList = generateSubSingleBenchmarkScoreSummary(problemBenchmarkResult); List<File> chartFileList = new ArrayList<File>(datasetList.size()); int scoreLevelIndex = 0; for (BoxAndWhiskerCategoryDataset dataset : datasetList) { CategoryPlot plot = new CategoryPlot(dataset, xAxis, yAxis, renderer); plot.setOrientation(PlotOrientation.VERTICAL); JFreeChart chart = new JFreeChart(problemBenchmarkResult + " (level " + scoreLevelIndex + ") single benchmark runs score distribution", JFreeChart.DEFAULT_TITLE_FONT, plot, true); chartFileList.add(writeChartToImageFile(chart, "SubSingleSummary" + problemBenchmarkResult.getAnchorId() + "Level" + scoreLevelIndex)); scoreLevelIndex++; } subSingleBenchmarkAggregationChartFileMap.put(problemBenchmarkResult, chartFileList); } }

Target:
private void writeSubSingleBenchmarkScoreCharts() { subSingleBenchmarkAggregationChartFileMap = new HashMap<ProblemBenchmarkResult, List<File>>(); CategoryAxis xAxis = new CategoryAxis("Solver Configurations"); NumberAxis yAxis = new NumberAxis("Scores distribution of single benchmark runs"); yAxis.setStandardTickUnits(NumberAxis.createIntegerTickUnits()); yAxis.setAutoRangeIncludesZero(false); BoxAndWhiskerRenderer renderer = new BoxAndWhiskerRenderer(){ @Override public int getRowCount() { return 1; } }; renderer.setFillBox(true); renderer.setUseOutlinePaintForWhiskers(true); renderer.setMedianVisible(true); renderer.setMeanVisible(false); renderer.setItemMargin(0.0d); for (ProblemBenchmarkResult problemBenchmarkResult : plannerBenchmarkResult.getUnifiedProblemBenchmarkResultList()) { List<? extends BoxAndWhiskerCategoryDataset> datasetList = generateSubSingleBenchmarkScoreSummary(problemBenchmarkResult); List<File> chartFileList = new ArrayList<File>(datasetList.size()); int scoreLevelIndex = 0; for (BoxAndWhiskerCategoryDataset dataset : datasetList) { CategoryPlot plot = new CategoryPlot(dataset, xAxis, yAxis, renderer); plot.setOrientation(PlotOrientation.VERTICAL); JFreeChart chart = new JFreeChart(problemBenchmarkResult + " (level " + scoreLevelIndex + ") single benchmark runs score distribution", JFreeChart.DEFAULT_TITLE_FONT, plot, true); chartFileList.add(writeChartToImageFile(chart, "SubSingleSummary" + problemBenchmarkResult.getAnchorId() + "Level" + scoreLevelIndex)); scoreLevelIndex++; } subSingleBenchmarkAggregationChartFileMap.put(problemBenchmarkResult, chartFileList); } }
Source:
public boolean evaluate(int threads, Statistics statistics) { OperationStats stats = statistics.getOperationsStats().get(on); if (stats == null) throw new IllegalStateException("No statistics for operation " + on); org.radargun.stats.representation.Percentile percentile = stats.getRepresentation(org.radargun.stats.representation.Percentile.class, value); if (percentile == null) throw new IllegalStateException("Cannot determine mean from " + stats); log.info("Response time is " + percentile.responseTimeMax + " ns " + PropertyHelper.toString(this)); if (below != null) return percentile.responseTimeMax < below; if (over != null) return percentile.responseTimeMax > over; throw new IllegalStateException(); }

Target:
public boolean evaluate(int threads, Statistics statistics) { OperationStats stats = statistics.getOperationsStats().get(on); if (stats == null) throw new IllegalStateException("No statistics for operation " + on); org.radargun.stats.representation.Percentile percentile = stats.getRepresentation(org.radargun.stats.representation.Percentile.class, value); if (percentile == null) throw new IllegalStateException("Cannot determine percentile from " + stats); log.info("Response time is " + percentile.responseTimeMax + " ns " + PropertyHelper.toString(this)); if (below != null) return percentile.responseTimeMax < below; if (over != null) return percentile.responseTimeMax > over; throw new IllegalStateException(); }
Source:
for (Change.Status s : Change.Status.values()) { ChangeStatusPredicate p = new ChangeStatusPredicate(s); PREDICATES.put(canonicalize(s), new ChangeStatusPredicate(s)); (s.isOpen() ? open : closed).add(p); }

Target:
for (Change.Status s : Change.Status.values()) { ChangeStatusPredicate p = new ChangeStatusPredicate(s); PREDICATES.put(canonicalize(s), p); (s.isOpen() ? open : closed).add(p); }