auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void configureConfigSubmitAllowedWithSystemReadAndManagePermission() throws Exception { HtmlPage configure = webClient.login(SYSTEM_READER) .goTo("configure"); assertThat(configure.getWebResponse().getStatusCode(), is(200)); HtmlForm configureForm = configure.getFormByName("config"); HtmlPage submit = j.submit(configureForm); assertThat(submit.getWebResponse().getStatusCode(), is(200)); }

Target:
public void configureConfigSubmitAllowedWithSystemReadAndManagePermission() throws Exception { HtmlPage configure = webClient.login(SYSTEM_READER_AND_MANAGER) .goTo("configure"); assertThat(configure.getWebResponse().getStatusCode(), is(200)); HtmlForm configureForm = configure.getFormByName("config"); HtmlPage submit = j.submit(configureForm); assertThat(submit.getWebResponse().getStatusCode(), is(200)); }
Source:
public Organization getOrganizationByName(String name) { ValidateArgument.required(name, "name"); try { DBOOrganization dbo = jdbcTemplate.queryForObject( "SELECT * FROM " + TABLE_ORGANIZATION + " WHERE " + COL_ORGANIZATION_NAME + " = ?", ROW_MAPPER, name.toLowerCase()); return createDtoFromDbo(dbo); } catch (EmptyResultDataAccessException e) { throw new NotFoundException("Orgnaization with name: '" + name.toLowerCase() + "' not found"); } }

Target:
public Organization getOrganizationByName(String name) { ValidateArgument.required(name, "name"); try { DBOOrganization dbo = jdbcTemplate.queryForObject( "SELECT * FROM " + TABLE_ORGANIZATION + " WHERE " + COL_ORGANIZATION_NAME + " = ?", ROW_MAPPER, name.toLowerCase()); return createDtoFromDbo(dbo); } catch (EmptyResultDataAccessException e) { throw new NotFoundException("Organization with name: '" + name.toLowerCase() + "' not found"); } }
Source:
public static Map<String, List<String>> getRawRoutingData() throws IOException { if (_rawRoutingData == null) { synchronized (HttpRoutingDataReader.class) { if (_rawRoutingData == null) { String msdsEndpoint = System.getProperty(MetadataStoreRoutingConstants.MSDS_SERVER_ENDPOINT_KEY); if (msdsEndpoint == null || msdsEndpoint.isEmpty()) { throw new IllegalStateException( "HttpRoutingDataReader was unable to find a valid MSDS endpoint String in System Properties!"); } CloseableHttpClient httpClient = HttpClients.createDefault(); _rawRoutingData = getAllRoutingData(httpClient, msdsEndpoint); httpClient.close(); } } } return _rawRoutingData; }

Target:
public static Map<String, List<String>> getRawRoutingData() throws IOException { if (MSDS_ENDPOINT == null || MSDS_ENDPOINT.isEmpty()) { throw new IllegalStateException( "HttpRoutingDataReader was unable to find a valid MSDS endpoint String in System Properties!"); } if (_rawRoutingData == null) { synchronized (HttpRoutingDataReader.class) { if (_rawRoutingData == null) { String routingDataJson = getAllRoutingData(); _rawRoutingData = parseRoutingData(routingDataJson); } } } return _rawRoutingData; }
Source:
public void sendAndReceiveMessage() throws Exception { Connection connection = null; Session session = null; Message receivedMessage = null; try { END A MESSAGE on the source queue connection = factory.createConnection(); session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); MessageProducer producer = session.createProducer(sourceQueue); String text = MESSAGE_TEXT + " " + UUID.randomUUID().toString(); Message message = session.createTextMessage(text); message.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT); producer.send(message); connection.start(); connection.close(); connection = factory.createConnection(); session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); MessageConsumer consumer = session.createConsumer(targetQueue); connection.start(); receivedMessage = consumer.receive(5000); assertNotNull("did not receive expected message", receivedMessage); assertTrue(receivedMessage instanceof TextMessage); assertEquals(text, ((TextMessage) receivedMessage).getText()); assertNotNull("did not get header set by the JMS bridge", receivedMessage.getStringProperty(ActiveMQJMSConstants.AMQ_MESSAGING_BRIDGE_MESSAGE_ID_LIST)); assertEquals("bridge metrics are not correct", 5000L,readMetrics()); } catch (Exception e) { e.printStackTrace(); } finally { if (session != null) { session.close(); } if (connection != null) { connection.close(); } } }

Target:
public void sendAndReceiveMessage() throws Exception { Connection connection = null; Session session = null; Message receivedMessage = null; try { assertEquals("Message count bridge metric is not correct", 0L, readMetric("message-count")); assertEquals("Aborted message count bridge metric is not correct", 0L, readMetric("aborted-message-count")); END A MESSAGE on the source queue connection = factory.createConnection(); session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); MessageProducer producer = session.createProducer(sourceQueue); String text = MESSAGE_TEXT + " " + UUID.randomUUID().toString(); Message message = session.createTextMessage(text); message.setJMSDeliveryMode(DeliveryMode.NON_PERSISTENT); producer.send(message); connection.start(); connection.close(); connection = factory.createConnection(); session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE); MessageConsumer consumer = session.createConsumer(targetQueue); connection.start(); receivedMessage = consumer.receive(5000); assertNotNull("did not receive expected message", receivedMessage); assertTrue(receivedMessage instanceof TextMessage); assertEquals(text, ((TextMessage) receivedMessage).getText()); assertNotNull("did not get header set by the JMS bridge", receivedMessage.getStringProperty(ActiveMQJMSConstants.AMQ_MESSAGING_BRIDGE_MESSAGE_ID_LIST)); assertEquals("Message count bridge metric is not correct", 1L, readMetric("message-count")); assertEquals("Aborted message count bridge metric is not correct", 0L, readMetric("aborted-message-count")); } catch (Exception e) { e.printStackTrace(); throw e; } finally { if (session != null) { session.close(); } if (connection != null) { connection.close(); } } }
Source:
public String addGateway(AuthzToken authzToken, Gateway gateway) throws TenantProfileServiceException, AuthorizationException, TException { try { if (!checkDuplicate(gateway)) { gateway = tenantProfileRepository.create(gateway); } if (gateway != null) { logger.info("Added Airavata Gateway with Id: " + gateway.getGatewayId()); if (gateway.getGatewayApprovalStatus().equals(GatewayApprovalStatus.APPROVED)) { logger.info("Gateway with ID: {}, is now APPROVED, replicating to subscribers.", gateway.getGatewayId()); ProfileServiceUtils.getDbEventPublisher().publish( ProfileServiceUtils.getDBEventMessageContext(EntityType.TENANT, CrudType.CREATE, gateway), DBEventManagerConstants.getRoutingKey(DBEventService.DB_EVENT.toString()) ); } return gateway.getGatewayId(); } else { throw new Exception("Gateway object is null."); } } catch (Exception ex) { logger.error("Error adding gateway-profile, reason: " + ex.getMessage(), ex); TenantProfileServiceException exception = new TenantProfileServiceException(); exception.setMessage("Error adding gateway-profile, reason: " + ex.getMessage()); throw exception; } }

Target:
public String addGateway(AuthzToken authzToken, Gateway gateway) throws TenantProfileServiceException, AuthorizationException, TException { try { if (!checkDuplicateGateway(gateway)) { gateway = tenantProfileRepository.create(gateway); if (gateway != null) { logger.info("Added Airavata Gateway with Id: " + gateway.getGatewayId()); if (gateway.getGatewayApprovalStatus().equals(GatewayApprovalStatus.APPROVED)) { logger.info("Gateway with ID: {}, is now APPROVED, replicating to subscribers.", gateway.getGatewayId()); ProfileServiceUtils.getDbEventPublisher().publish( ProfileServiceUtils.getDBEventMessageContext(EntityType.TENANT, CrudType.CREATE, gateway), DBEventManagerConstants.getRoutingKey(DBEventService.DB_EVENT.toString()) ); } return gateway.getGatewayId(); } else { throw new Exception("Gateway object is null."); } } else { throw new TenantProfileServiceException("An approved Gateway already exists with the same GatewayId, Name or URL"); } } catch (Exception ex) { logger.error("Error adding gateway-profile, reason: " + ex.getMessage(), ex); TenantProfileServiceException exception = new TenantProfileServiceException(); exception.setMessage("Error adding gateway-profile, reason: " + ex.getMessage()); throw exception; } }
Source:
public void receiveResponse(Exchange exchange, Response response) { Request request = exchange.getCurrentRequest(); if(!isProtected(response)) { LOGGER.warn("Incoming response is NOT OSCORE protected!"); } else { LOGGER.info("Incoming response is OSCORE protected"); } if (request == null) { LOGGER.error("No request tied to this response"); return; } try { if (isProtected(response)) { response = prepareReceive(response); } } catch (OSException e) { LOGGER.error("Error while receiving OSCore response: " + e.getMessage()); EmptyMessage error = CoapOSExceptionHandler.manageError(e, response); if (error != null) { sendEmptyMessage(exchange, error); } return; } super.receiveResponse(exchange, response); }

Target:
public void receiveResponse(Exchange exchange, Response response) { Request request = exchange.getCurrentRequest(); if (request == null) { LOGGER.error("No request tied to this response"); return; } try { if (!isProtected(response) && responseShouldBeProtected(exchange, response)) { LOGGER.warn("Incoming response is NOT OSCORE protected!"); } else if (isProtected(response)) { LOGGER.info("Incoming response is OSCORE protected"); } if (isProtected(response)) { response = prepareReceive(response); } } catch (OSException e) { LOGGER.error("Error while receiving OSCore response: " + e.getMessage()); EmptyMessage error = CoapOSExceptionHandler.manageError(e, response); if (error != null) { sendEmptyMessage(exchange, error); } return; } super.receiveResponse(exchange, response); }
Source:
public final void create() { if (CLEAR_SETTINGS) { Preferences preferences = Gdx.app.getPreferences("TIMER"); preferences.clear(); preferences.flush(); } Gdx.app.setLogLevel(Application.LOG_DEBUG); cTimeKeeper = TimerStore.getInstance().getTimeKeeper(); cStandUp = StandUp.getInstance(); Collection c = new Collection(); c.add(new FishA(780)); c.add(new FishB(580)); c.add(new FishC(380)); ScreenStore cScreenStore = ScreenStore.getInstance(); setScreen(cScreenStore.getWorldRenderer()); cScreenStore.init(c); cScreenStore.setScreen("Home"); }

Target:
public final void create() { if (CLEAR_SETTINGS) { Preferences preferences = Gdx.app.getPreferences("TIMER"); preferences.clear(); preferences.flush(); } Gdx.app.setLogLevel(Application.LOG_DEBUG); cTimeKeeper = TimerStore.getInstance().getTimeKeeper(); cStandUp = StandUp.getInstance(); int fa = 0, fb = 0, fc = 0; Collection c = new Collection("local"); RewardGenerator gen = new RewardGenerator(); for(int i = 0; i < 500; i++) { Collectible ca = gen.generateCollectible(1); c.add(ca); if(ca instanceof FishA) { fa++; } else if (ca instanceof FishB) { fb++; } else { fc++; } } System.out.println("Fish A: " + fa + " Fish B: " + fb + " Fish C: " + fc); ScreenStore cScreenStore = ScreenStore.getInstance(); setScreen(cScreenStore.getWorldRenderer()); cScreenStore.init(c); cScreenStore.setScreen("Home"); }
Source:
public void handle(RMNode node) { if (!initialized || node.isLocked() || isRestorationCompleted()) { if (log.isDebugEnabled()) { String nodeUrl = node.getNodeURL(); if (!initialized) { logSkipReason(nodeUrl, "manager is not yet initialized"); } else if (node.isLocked()) { logSkipReason(nodeUrl, "it is locked"); } else { logSkipReason(nodeUrl, "restoration is complete"); } } return; } String nodeSource = node.getNodeSourceName(); MutableInteger nodeCount = nodeLockedOnPreviousRun.get(nodeSource); if (nodeCount != null) { lockNode(node); if (nodeCount.add(-1) == 0) { nodeLockedOnPreviousRun.remove(nodeSource); } } }

Target:
public void handle(RMNode node) { if (!isNodeValidToBeRestored(node)) { if (log.isDebugEnabled()) { String nodeUrl = node.getNodeURL(); if (!initialized) { logSkipReason(nodeUrl, "manager is not yet initialized"); } else if (node.isLocked()) { logSkipReason(nodeUrl, "it is locked"); } else { logSkipReason(nodeUrl, "restoration is complete"); } } return; } String nodeSource = node.getNodeSourceName(); MutableInteger nodeCount = nodeLockedOnPreviousRun.get(nodeSource); if (nodeCount != null) { lockNode(node); int newNodeCount = nodeCount.add(-1); if (newNodeCount == 0) { nodeLockedOnPreviousRun.remove(nodeSource); } } }
Source:
public void start(final BundleContext context) throws Exception { super.start(context); Dictionary<String, String> props = new Hashtable<String, String>(4); props.put(DebugOptions.LISTENER_SYMBOLICNAME, context.getBundle() .getSymbolicName()); context.registerService(DebugOptionsListener.class.getName(), this, props); setupSSH(context); setupProxy(context); setupRepoChangeScanner(); setupRepoIndexRefresh(); if (PlatformUI.isWorkbenchRunning()) setupFocusHandling(); setupCredentialsProvider(); ConfigurationChecker.checkConfiguration(); }

Target:
public void start(final BundleContext context) throws Exception { super.start(context); Dictionary<String, String> props = new Hashtable<String, String>(4); props.put(DebugOptions.LISTENER_SYMBOLICNAME, context.getBundle() .getSymbolicName()); context.registerService(DebugOptionsListener.class.getName(), this, props); setupSSH(context); setupProxy(context); setupRepoChangeScanner(); setupRepoIndexRefresh(); setupFocusHandling(); setupCredentialsProvider(); ConfigurationChecker.checkConfiguration(); }
Source:
public final Set<SequenceSegment> getVisibleSegments(final int position) { Set<SequenceSegment> copy = new TreeSet<SequenceSegment>(); try { for (SequenceSegment seg : segmentBuckets.getSegments(position)) { copy.add(seg.clone()); } } catch (CloneNotSupportedException e) { Logging.exception(e); } copy.retainAll(visibles); if (visibleSequences != null) { for (SequenceSegment vertex : copy) { vertex.getSources().retainAll(visibleSequences); } } return copy; }

Target:
public final Set<SequenceSegment> getVisibleSegments(final int position) { Set<SequenceSegment> copy = new TreeSet<SequenceSegment>(); for (SequenceSegment seg : segmentBuckets.getSegments(position)) { try { copy.add(seg.clone()); } catch (CloneNotSupportedException e) { Logging.exception(e); } } copy.retainAll(visibles); if (visibleSequences != null) { for (SequenceSegment vertex : copy) { vertex.getSources().retainAll(visibleSequences); } } return copy; }
Source:
private ModelAndView redirectToAssetFile(HttpServletRequest request, Site site, String id, String fileType, boolean isDownload) { Link.Factory.PatternBuilder link = Link.toLocalSite(site) .toPattern(requestMappingContextDictionary, "assetFile") .addQueryParameter("id", id) .addQueryParameter("type", fileType); if (isDownload) { link = link.addQueryParameter("download", ""); } RedirectView redirectView = new RedirectView(link.build().getRedirect(request)); redirectView.setStatusCode(HttpStatus.MOVED_PERMANENTLY); return new ModelAndView(redirectView); }

Target:
private ModelAndView redirectToAssetFile(HttpServletRequest request, Site site, String id, String fileType, boolean isDownload) { Link.Factory.PatternBuilder link = Link.toLocalSite(site) .toPattern(requestMappingContextDictionary, "assetFile") .addQueryParameter("id", id) .addQueryParameter("type", fileType); if (isDownload) { link = link.addQueryParameter("download", ""); } return new ModelAndView(link.build().getRedirect(request)); }
Source:
public void setUp() throws Exception { DbFacadeLocator.setDbFacade(dbFacade); when(dbFacade.getStoragePoolDao()).thenReturn(storagePoolDao); when(dbFacade.getVmNicDao()).thenReturn(vmNicDao); when(dbFacade.getMacPoolDao()).thenReturn(macPoolDao); macFrom = "00:1a:4a:15:c0:00"; macTo = "00:1a:4a:15:c0:ff"; macPool = createMacPool(macFrom, macTo); dataCenter = createStoragePool(macPool); vmNic = createVmNic(); }

Target:
public void setUp() throws Exception { DbFacadeLocator.setDbFacade(dbFacade); when(dbFacade.getStoragePoolDao()).thenReturn(storagePoolDao); when(dbFacade.getVmNicDao()).thenReturn(vmNicDao); when(dbFacade.getMacPoolDao()).thenReturn(macPoolDao); when(dbFacade.getAuditLogDao()).thenReturn(auditLogDao); macPool = createMacPool(MAC_FROM, MAC_TO); dataCenter = createStoragePool(macPool); vmNic = createVmNic(); pool = new MacPoolPerDc(); }
Source:
public void init(HttpServletRequest request, HttpServletResponse response) { RequestData data = monitor.current(); if (data == null) { return; } data.setCategory(Category.REST); if (request.getPathInfo() != null) { try { String resource = Paths.get(URLEncoder.encode(request.getPathInfo(), Charset.defaultCharset().name())).getFileName().toString(); resource = FilenameUtils.getBaseName(resource); data.getResources().add(resource); } catch (UnsupportedEncodingException e) { LOGGER.log(Level.SEVERE, e.getMessage(), e); } } monitor.update(); }

Target:
public void init(HttpServletRequest request, HttpServletResponse response) { RequestData data = monitor.current(); if (data == null) { return; } data.setCategory(Category.REST); if (request.getPathInfo() != null) { String resource = request.getPathInfo(); final String[] pathParts = resource.split("/"); data.getResources().add(pathParts[pathParts.length - 1]); } monitor.update(); }
Source:
private long findUnusedMac() { int index = usedMacs.nextClearBit(startingLocationWhenSearchingForUnusedMac); boolean notFound = index == numberOfMacsInRange; if (notFound) { index = usedMacs.nextClearBit(0); } startingLocationWhenSearchingForUnusedMac = index + 1; return rangeStart + index; }

Target:
private long findUnusedMac() { int index = usedMacs.nextClearBit(startingLocationWhenSearchingForUnusedMac); boolean notFound = index == numberOfMacsInRange; if (notFound) { index = usedMacs.nextClearBit(0); } startingLocationWhenSearchingForUnusedMac = (index + 1) % numberOfMacsInRange; return rangeStart + index; }
Source:
public void testToJsonOnClass() throws IOException { checkToJson(new Function<Statistics, String>() { @Override public String apply(Statistics t) { try { return Statistics.toJson(t); } catch (JsonProcessingException e) { e.printStackTrace(); } return null; } }); }

Target:
public void testToJsonOnClass() throws IOException { checkToJson(new Function<Statistics, String>() { @Override public String apply(Statistics t) { try { return Statistics.toJson(t); } catch (JsonProcessingException e) { Assert.fail(e.toString()); } return null; } }); }
Source:
private static Number evaluateBinding(IBinding b) { if (b instanceof IType) { return VALUE_CANNOT_BE_DETERMINED; } if (b instanceof ICPPTemplateNonTypeParameter) { return null; } if (b instanceof ICPPUnknownBinding) { return null; } IValue value= null; if (b instanceof IVariable) { IVariable bVar = (IVariable) b; IType realType = SemanticUtil.getNestedType(bVar.getType(), SemanticUtil.TDEF); if (realType instanceof IQualifierType) { if (((IQualifierType)realType).isConst()) { value= ((IVariable) b).getInitialValue(); } } } else if (b instanceof IEnumerator) { value= ((IEnumerator) b).getValue(); } if (value != null && value != Value.UNKNOWN) { return value.numericalValue(); } return VALUE_CANNOT_BE_DETERMINED; }

Target:
private static Number evaluateBinding(IBinding b) { if (b instanceof IType) { return VALUE_CANNOT_BE_DETERMINED; } if (b instanceof ICPPTemplateNonTypeParameter) { return null; } if (b instanceof ICPPUnknownBinding) { return null; } IValue value= null; if (b instanceof IVariable) { value= ((IVariable) b).getInitialValue(); } else if (b instanceof IEnumerator) { value= ((IEnumerator) b).getValue(); } if (value != null && value != Value.UNKNOWN) { return value.numericalValue(); } return VALUE_CANNOT_BE_DETERMINED; }
Source:
private JSONObject getJsonFromUri(final String path) throws IOException, JSONException { try { URI pathUi = new URI(null, null, path, null); URL url = new URL(this.remoteAssetsConfig.getServer() + pathUi.toString() + ".1.json"); HttpURLConnection connection = (HttpURLConnection) url.openConnection(); connection.setRequestProperty("Authorization", String.format("Basic %s", RemoteAssets.encodeForBasicAuth(this.remoteAssetsConfig))); try (BufferedReader br = new BufferedReader(new InputStreamReader(connection.getInputStream()))) { String line; StringBuilder sb = new StringBuilder(); while ((line = br.readLine()) != null) { sb.append(line); } String sbString = sb.toString(); if (StringUtils.startsWith(sbString, "{")) { if (LOG.isDebugEnabled()) { LOG.debug("JSON successfully fetched for URL '{}'.", url.toString()); } return new JSONObject(sbString); } else { LOG.error("Unable to grab JSON Object. Please ensure URL is valid. \nRaw Response: {}", url.toString(), sbString); } } finally { connection.disconnect(); } } catch (URISyntaxException e) { LOG.error("URI Syntax Exception {}", e); } throw new JSONException("Response JSON came back null."); }

Target:
private JsonObject getJsonFromUri(final String path) throws IOException { URI pathUri; try { pathUri = new URI(null, null, path, null); } catch (URISyntaxException e) { LOG.error("URI Syntax Exception", e); throw new IOException("Invalid URI", e); } String url = this.remoteAssetsConfig.getServer() + pathUri.toString() + ".1.json"; Executor executor = this.remoteAssetsConfig.getRemoteAssetsHttpExecutor(); String responseString = executor.execute(Request.Get(url)).returnContent().asString(); try { JsonObject responseJson = new JsonParser().parse(responseString).getAsJsonObject(); LOG.debug("JSON successfully fetched for URL '{}'.", url); return responseJson; } catch (JsonSyntaxException | IllegalStateException e) { LOG.error("Unable to grab JSON Object. Please ensure URL is valid. \nRaw Response: {}", url, responseString); throw new IOException("Invalid JSON response", e); } }
Source:
public void testDeleteJobs() throws Exception { JobsList.listJobs(PROJECT_ID); String output = bout.toString(); Matcher matcher = JOB_ID_PATTERN.matcher(bout.toString()); assertTrue("List must contain results.", matcher.find()); String jobId = matcher.group(0).split("/")[3]; bout.reset(); JobsDelete.deleteJobs(PROJECT_ID, jobId); output = bout.toString(); assertTrue(output.contains("Job deleted successfully.")); }

Target:
public void testDeleteJobs() throws Exception { String jobId = UUID.randomUUID().toString(); createJob(jobId); JobsDelete.deleteJobs(PROJECT_ID, "i-" + jobId); String output = bout.toString(); assertThat(output, CoreMatchers.containsString("Job deleted successfully.")); }
Source:
private static List<VmDevice> sortInterfacesByName(VM vm, List<VmDevice> pluggedInterfaces) { if (pluggedInterfaces.size() < 2) { return pluggedInterfaces; } final HashMap<Guid, String> deviceIdToIfaceName = new HashMap<Guid, String>(); for (VmNetworkInterface iface : vm.getInterfaces()) { deviceIdToIfaceName.put(iface.getId(), iface.getName()); } Collections.sort(pluggedInterfaces, new Comparator<VmDevice>() { @Override public int compare(VmDevice first, VmDevice second) { Guid firstDeviceId = first.getId().getDeviceId(); Guid secondDeviceId = second.getId().getDeviceId(); String firstIfaceName = deviceIdToIfaceName.get(firstDeviceId); String secondIfaceName = deviceIdToIfaceName.get(secondDeviceId); return firstIfaceName.compareTo(secondIfaceName); } }); return pluggedInterfaces; }

Target:
private static List<VmDevice> sortInterfacesByName(VM vm, List<VmDevice> pluggedInterfaces) { if (pluggedInterfaces.size() < 2) { return pluggedInterfaces; } final Map<Guid, String> deviceIdToIfaceName = new HashMap<Guid, String>(); for (VmNetworkInterface iface : vm.getInterfaces()) { deviceIdToIfaceName.put(iface.getId(), iface.getName()); } Collections.sort(pluggedInterfaces, new Comparator<VmDevice>() { @Override public int compare(VmDevice first, VmDevice second) { Guid firstDeviceId = first.getId().getDeviceId(); Guid secondDeviceId = second.getId().getDeviceId(); String firstIfaceName = deviceIdToIfaceName.get(firstDeviceId); String secondIfaceName = deviceIdToIfaceName.get(secondDeviceId); return firstIfaceName.compareTo(secondIfaceName); } }); return pluggedInterfaces; }
Source:
protected boolean validate() { if (getVds() == null && !selectProxyHost()) { return failValidation(EngineMessage.ACTION_TYPE_FAILED_NO_VDS_IN_POOL); } return true; }

Target:
protected boolean validate() { DiskValidator diskValidator = new DiskValidator(getDiskImage(), vmDeviceUtils); if (!validate(diskValidator.isDiskExists()) || !validate(diskValidator.isDiskPluggedToVmsThatAreNotDown(false, vmsForDisk))) { return false; } DiskImagesValidator diskImagesValidator = new DiskImagesValidator(Collections.singletonList(getDiskImage())); return validate(diskImagesValidator.diskImagesNotIllegal()) && validate(diskImagesValidator.diskImagesNotLocked()) && validate(diskImagesValidator.diskImagesHaveNoDerivedDisks(null)); }
Source:
public static boolean deleteRealm(String canonicalPath, File realmFolder, String realmFileName) { final String management = ".management"; File managementFolder = new File(realmFolder, realmFileName + management); File realmFile = new File(canonicalPath); File[] files = managementFolder.listFiles(); if (files != null) { for (File file : files) { boolean deleteResult = file.delete(); if (!deleteResult) { RealmLog.warn( String.format(Locale.ENGLISH,"Realm temporary file at %s cannot deleted", file.getAbsolutePath())); } } } if (managementFolder.exists() && !managementFolder.delete()) { RealmLog.warn( String.format(Locale.ENGLISH,"Realm temporary folder at %s cannot deleted", managementFolder.getAbsolutePath())); } boolean realmDeleted; if (realmFile.exists()) { realmDeleted = realmFile.delete(); if (!realmDeleted) { RealmLog.warn( String.format(Locale.ENGLISH,"Realm file at %s cannot deleted", realmFile.getAbsolutePath())); } } else { realmDeleted = true; } return realmDeleted; }

Target:
public static boolean deleteRealm(String canonicalPath, File realmFolder, String realmFileName) { final String management = ".management"; File managementFolder = new File(realmFolder, realmFileName + management); File realmFile = new File(canonicalPath); File[] files = managementFolder.listFiles(); if (files != null) { for (File file : files) { boolean deleteResult = file.delete(); if (!deleteResult) { RealmLog.warn( String.format(Locale.ENGLISH,"Realm temporary file at %s cannot be deleted", file.getAbsolutePath())); } } } if (managementFolder.exists() && !managementFolder.delete()) { RealmLog.warn( String.format(Locale.ENGLISH,"Realm temporary folder at %s cannot be deleted", managementFolder.getAbsolutePath())); } boolean realmDeleted; if (realmFile.exists()) { realmDeleted = realmFile.delete(); if (!realmDeleted) { RealmLog.warn(String.format(Locale.ENGLISH,"Realm file at %s cannot be deleted", realmFile.getAbsolutePath())); } } else { realmDeleted = true; } return realmDeleted; }
Source:
public static ArrayPool<boolean[]> getBooleanArrayPool() { synchronized (Caches.class) { if (booleanArrayPool == null) { booleanArrayPool = new ArrayPool(16, 64 * 1024, 1024 * 1024, new BooleanArrayAllocator()); } } return booleanArrayPool; }

Target:
public static ArrayPool<boolean[]> getBooleanArrayPool() { synchronized (Caches.class) { if (booleanArrayPool == null) { booleanArrayPool = new ArrayPool(BOOLEAN_SMALLEST_ARRAY_SIZE, BOOLEAN_LARGEST_ARRAY_SIZE, BOOLEAN_POOL_CAPACITY, new BooleanArrayAllocator()); } } return booleanArrayPool; }
Source:
void onSaveProfileClicked() { Timber.v("Attempting to save profile"); String firstName = firstNameEditText.getText().toString(); String lastName = lastNameEditText.getText().toString(); UserSpec spec = new UserSpec(); User user = new User(); user.getData().attributes().firstName(firstName); user.getData().attributes().lastName(lastName); spec.create(new CreateUserRequest()); spec.update(user); userRepo.update(spec) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .doOnCompleted( new Action0() { @Override public void call() { Timber.v("Profile saved"); ToastService.get(getView()).bern(getView().getContext().getString(R.string.profile_saved)); Flow.get(getView().getContext()).set(new HomeScreen()); } } ) .doOnError( new Action1<Throwable>() { @Override public void call(Throwable throwable) { Timber.e("Unable to save profile", throwable); ToastService.get(getView()).bern(getView().getContext().getString(R.string.error_saving_profile)); } } ) .subscribe(); }

Target:
void onSaveProfileClicked() { Timber.v("Attempting to save profile"); String firstName = firstNameEditText.getText().toString(); String lastName = lastNameEditText.getText().toString(); UserSpec spec = new UserSpec(); User user = new User(); user.getData().attributes().firstName(firstName); user.getData().attributes().lastName(lastName); spec.create(new CreateUserRequest()); spec.update(user); userRepo.update(spec) .subscribeOn(Schedulers.io()) .observeOn(AndroidSchedulers.mainThread()) .doOnCompleted( new Action0() { @Override public void call() { Timber.v("Profile saved"); ProfileView view = getView(); if (view != null) { ToastService.get(view).bern(view.getContext().getString(R.string.profile_saved)); Flow.get(view.getContext()).set(new HomeScreen()); } else { Timber.w("getView() null, cannot notify user of successful profile save"); } } } ) .doOnError( new Action1<Throwable>() { @Override public void call(Throwable throwable) { Timber.e(throwable, "Unable to save profile"); Bugsnag.notify(throwable); ProfileView view = getView(); if (view != null) { ToastService.get(view).bern(view.getContext().getString(R.string.error_saving_profile)); } else { Timber.w("getView() null, cannot notify user of failed profile save"); } } } ) .subscribe(); }
Source:
protected GroovyCodeVisitor getTransformer(ASTNode[] nodes, final SourceUnit sourceUnit) { final ClassLoader classLoader = this.getClass().getClassLoader(); return new ClassCodeVisitorSupport() { @Override protected SourceUnit getSourceUnit() { return sourceUnit; } @Override public void visitMethodCallExpression(MethodCallExpression call) { super.visitMethodCallExpression(call); List<MethodNode> methods = MacroMethodsCache.get(classLoader).get(call.getMethodAsString()); if (methods == null) { return; } List<Expression> callArguments = InvocationWriter.makeArgumentList(call.getArguments()).getExpressions(); ClassNode[] argumentsList = new ClassNode[callArguments.size()]; for (int i = 0; i < callArguments.size(); i++) { argumentsList[i] = ClassHelper.make(callArguments.get(i).getClass()); } methods = StaticTypeCheckingSupport.chooseBestMethod(MACRO_CONTEXT_CLASS_NODE, methods, argumentsList); for (MethodNode macroMethodNode : methods) { if (!(macroMethodNode instanceof ExtensionMethodNode)) { continue; } MethodNode macroExtensionMethodNode = ((ExtensionMethodNode) macroMethodNode).getExtensionMethodNode(); final Class clazz; try { clazz = classLoader.loadClass(macroExtensionMethodNode.getDeclaringClass().getName()); } catch (ClassNotFoundException e) { continue; } MacroContext macroContext = new MacroContext(unit, sourceUnit, call); List<Object> macroArguments = new ArrayList<>(); macroArguments.add(macroContext); macroArguments.addAll(callArguments); Expression result = (Expression) InvokerHelper.invokeStaticMethod(clazz, macroMethodNode.getName(), macroArguments.toArray()); call.setObjectExpression(MACRO_STUB_INSTANCE); call.setMethod(new ConstantExpression(MACRO_STUB_METHOD_NAME)); call.setSpreadSafe(false); call.setSafe(false); call.setImplicitThis(false); call.setArguments(result); break; } } }; }

Target:
protected GroovyCodeVisitor getTransformer(ASTNode[] nodes, final SourceUnit sourceUnit) { return new MacroCallTransformingVisitor(sourceUnit, unit); }
Source:
public Optional get(final J2EContext context, final String key) { return Optional.of(getHttpSession(context).getAttribute(key)); }

Target:
public Optional get(final J2EContext context, final String key) { return Optional.ofNullable(getHttpSession(context).getAttribute(key)); }
Source:
public static int getOffsetForCursorLocation(ITextViewer viewer) { try { StyledText text= viewer.getTextWidget(); if (text == null || text.isDisposed()) return -1; Display display= text.getDisplay(); Point absolutePosition= display.getCursorLocation(); Point relativePosition= text.toControl(absolutePosition); int widgetOffset= text.getOffsetAtPoint(relativePosition); Point p= text.getLocationAtOffset(widgetOffset); if (p.x > relativePosition.x) widgetOffset--; if (viewer instanceof ITextViewerExtension5) { ITextViewerExtension5 extension= (ITextViewerExtension5)viewer; return extension.widgetOffset2ModelOffset(widgetOffset); } return widgetOffset + viewer.getVisibleRegion().getOffset(); } catch (IllegalArgumentException e) { return -1; } }

Target:
public static int getOffsetForCursorLocation(ITextViewer viewer) { try { StyledText text= viewer.getTextWidget(); if (text == null || text.isDisposed()) { return -1; } Display display= text.getDisplay(); Point absolutePosition= display.getCursorLocation(); Point relativePosition= text.toControl(absolutePosition); int widgetOffset= text.getOffsetAtPoint(relativePosition); if (widgetOffset == -1) { return -1; } Point p= text.getLocationAtOffset(widgetOffset); if (p.x > relativePosition.x) { widgetOffset--; } if (viewer instanceof ITextViewerExtension5) { ITextViewerExtension5 extension= (ITextViewerExtension5)viewer; return extension.widgetOffset2ModelOffset(widgetOffset); } return widgetOffset + viewer.getVisibleRegion().getOffset(); } catch (IllegalArgumentException e) { return -1; } }
Source:
protected String[] customCommandLineValidation() { try { final boolean isBamOrSamOrCramFile = isBamOrSamOrCram(IOUtil.getPath(INPUT)); if (!isBamOrSamOrCramFile && IGNORE_READ_GROUPS) { return new String[]{"The parameter IGNORE_READ_GROUPS can only be used with BAM/SAM/CRAM inputs."}; } if (isBamOrSamOrCramFile && OBSERVED_SAMPLE_ALIAS != null) { return new String[]{"The parameter OBSERVED_SAMPLE_ALIAS can only be used with a VCF input."}; } } catch (IOException e) { e.printStackTrace(); } if (REFERENCE_SEQUENCE == null && INPUT.endsWith(SamReader.Type.CRAM_TYPE.fileExtension())) { return new String[]{"REFERENCE must be provided when using CRAM as input."}; } return super.customCommandLineValidation(); }

Target:
protected String[] customCommandLineValidation() { try { final boolean fileContainsReads = fileContainsReads(IOUtil.getPath(INPUT)); if (!fileContainsReads && IGNORE_READ_GROUPS) { return new String[]{"The parameter IGNORE_READ_GROUPS can only be used with BAM/SAM/CRAM inputs."}; } if (fileContainsReads && OBSERVED_SAMPLE_ALIAS != null) { return new String[]{"The parameter OBSERVED_SAMPLE_ALIAS can only be used with a VCF input."}; } } catch (IOException e) { e.printStackTrace(); } if (REFERENCE_SEQUENCE == null && INPUT.endsWith(SamReader.Type.CRAM_TYPE.fileExtension())) { return new String[]{"REFERENCE must be provided when using CRAM as input."}; } return super.customCommandLineValidation(); }
Source:
public void testInvalidQuestionNumber() { FeedbackSessionAttributes fs = typicalBundle.feedbackSessions.get("session1InCourse1"); String[] params = new String[] { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), Const.ParamsNames.FEEDBACK_QUESTION_TEMPLATE_NUMBER, "6" }; verifyAssumptionFailure(params); modifyParamValue(params, Const.ParamsNames.FEEDBACK_QUESTION_TEMPLATE_NUMBER, "0"); verifyAssumptionFailure(params); modifyParamValue(params, Const.ParamsNames.FEEDBACK_QUESTION_TEMPLATE_NUMBER, "ABC"); try { InstructorFeedbackTemplateQuestionAddAction action = getAction(params); action.executeAndPostProcess(); signalFailureToDetectException(); } catch (NumberFormatException e) { ignoreExpectedException(); } }

Target:
public void testInvalidQuestionNumber() { FeedbackSessionAttributes fs = typicalBundle.feedbackSessions.get("session1InCourse1"); ______TS("Input for template question is more than the range"); String[] params = new String[] { Const.ParamsNames.COURSE_ID, fs.getCourseId(), Const.ParamsNames.FEEDBACK_SESSION_NAME, fs.getFeedbackSessionName(), Const.ParamsNames.FEEDBACK_QUESTION_TEMPLATE_NUMBER, "6" }; verifyAssumptionFailure(params); ______TS("Input for template question is lesser than the range"); modifyParamValue(params, Const.ParamsNames.FEEDBACK_QUESTION_TEMPLATE_NUMBER, "0"); verifyAssumptionFailure(params); ______TS("Input for template question is a word"); modifyParamValue(params, Const.ParamsNames.FEEDBACK_QUESTION_TEMPLATE_NUMBER, "ABC"); try { InstructorFeedbackTemplateQuestionAddAction action = getAction(params); action.executeAndPostProcess(); signalFailureToDetectException(); } catch (NumberFormatException e) { ignoreExpectedException(); } }
Source:
private Exception convertThrowableToException(Throwable e) { if (e.getCause() instanceof Exception) { return (Exception) e.getCause(); } else { return new RuntimeException(e); } }

Target:
private Exception convertThrowableToException(Throwable e) { if (e instanceof Exception) { return (Exception) e; } else { return new RuntimeException(e); } }
Source:
protected int computeGrowthAmount(Material material) { if (!isAdult() && getBreedingFoods().contains(material)) { return Math.abs(getAge() / 10); } else { return 0; } }

Target:
protected int computeGrowthAmount(Material material) { if (!isAdult() && getBreedingFoods().contains(material)) { return Math.abs(getAge() / 10); } return 0; }
Source:
protected MultivaluedMap<String, String> setRequestHeaders(MultivaluedMap<String, String> headers, OperationResourceInfo ori, boolean formParams, Class<?> bodyClass, Class<?> responseClass) { if (headers.getFirst(HttpHeaders.CONTENT_TYPE) == null) { if (formParams || bodyClass != null && MultivaluedMap.class.isAssignableFrom(bodyClass)) { headers.putSingle(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED); } else { String ctType = null; List<MediaType> consumeTypes = ori.getConsumeTypes(); if (!consumeTypes.isEmpty() && !consumeTypes.get(0).equals(MediaType.WILDCARD_TYPE)) { ctType = JAXRSUtils.mediaTypeToString(ori.getConsumeTypes().get(0)); } if (ctType != null) { headers.putSingle(HttpHeaders.CONTENT_TYPE, ctType); } } } List<MediaType> accepts = getAccept(headers); if (accepts == null) { List<MediaType> produceTypes = ori.getProduceTypes(); if (responseClass == Void.class || responseClass == Void.TYPE) { accepts = Collections.singletonList(MediaType.WILDCARD_TYPE); } else { boolean produceWildcard = produceTypes.isEmpty() || produceTypes.get(0).equals(MediaType.WILDCARD_TYPE); if (produceWildcard) { accepts = InjectionUtils.isPrimitive(responseClass) ? Collections.singletonList(MediaType.TEXT_PLAIN_TYPE) : Collections.singletonList(MediaType.APPLICATION_XML_TYPE); } else { accepts = produceTypes; } } for (MediaType mt : accepts) { headers.add(HttpHeaders.ACCEPT, JAXRSUtils.mediaTypeToString(mt)); } } return headers; }

Target:
protected MultivaluedMap<String, String> setRequestHeaders(MultivaluedMap<String, String> headers, OperationResourceInfo ori, boolean formParams, Class<?> bodyClass, Class<?> responseClass) { if (headers.getFirst(HttpHeaders.CONTENT_TYPE) == null) { if (formParams || bodyClass != null && MultivaluedMap.class.isAssignableFrom(bodyClass)) { headers.putSingle(HttpHeaders.CONTENT_TYPE, MediaType.APPLICATION_FORM_URLENCODED); } else { String ctType = null; List<MediaType> consumeTypes = ori.getConsumeTypes(); if (!consumeTypes.isEmpty() && !consumeTypes.get(0).equals(MediaType.WILDCARD_TYPE)) { ctType = JAXRSUtils.mediaTypeToString(ori.getConsumeTypes().get(0)); } if (ctType != null) { headers.putSingle(HttpHeaders.CONTENT_TYPE, ctType); } } } List<MediaType> accepts = getAccept(headers); if (accepts == null) { if (responseClass == Void.class || responseClass == Void.TYPE) { accepts = Collections.singletonList(MediaType.WILDCARD_TYPE); } else { List<MediaType> produceTypes = ori.getProduceTypes(); boolean produceWildcard = produceTypes.isEmpty() || produceTypes.get(0).equals(MediaType.WILDCARD_TYPE); if (produceWildcard) { accepts = InjectionUtils.isPrimitive(responseClass) ? Collections.singletonList(MediaType.TEXT_PLAIN_TYPE) : Collections.singletonList(MediaType.APPLICATION_XML_TYPE); } else { accepts = produceTypes; } } for (MediaType mt : accepts) { headers.add(HttpHeaders.ACCEPT, JAXRSUtils.mediaTypeToString(mt)); } } return headers; }
Source:
public static String getServicePrincipal(String serviceName, String hostName) throws UnknownHostException { requireNonNull(serviceName, "serviceName is null"); requireNonNull(hostName, "hostName is null"); InetAddress address = InetAddress.getByName(hostName); String fqdn; if (address.getHostName().toLowerCase().startsWith("localhost")) { return getServicePrincipal(serviceName); } fqdn = address.getCanonicalHostName(); return String.format("%s/%s", serviceName, fqdn.toLowerCase(Locale.US)); }

Target:
public static String getServicePrincipal(String serviceName, String hostName) throws UnknownHostException { requireNonNull(serviceName, "serviceName is null"); requireNonNull(hostName, "hostName is null"); InetAddress address = InetAddress.getByName(hostName); String fqdn; if ("localhost".equalsIgnoreCase(address.getHostName())) { return getServicePrincipal(serviceName); } fqdn = address.getCanonicalHostName(); return format("%s/%s", serviceName, fqdn.toLowerCase(Locale.US)); }
Source:
public void initialize(ConfigurableListableBeanFactory configurableListableBeanFactory) throws BeansException { Assert.isInstanceOf(BeanDefinitionRegistry.class, configurableListableBeanFactory, "To use Spring Integration Java DSL the 'beanFactory' has to be an instance of " + "'BeanDefinitionRegistry'. Consider using 'GenericApplicationContext' implementation." ); BeanDefinitionRegistry registry = (BeanDefinitionRegistry) configurableListableBeanFactory; if (!registry.containsBeanDefinition(INTEGRATION_FLOW_BPP_BEAN_NAME)) { registry.registerBeanDefinition(INTEGRATION_FLOW_BPP_BEAN_NAME, new RootBeanDefinition(IntegrationFlowBeanPostProcessor.class)); registry.registerBeanDefinition(INTEGRATION_FLOW_CONTEXT_BEAN_NAME, new RootBeanDefinition(StandardIntegrationFlowContext.class)); } if (!configurableListableBeanFactory.containsBean(INTEGRATION_FLOW_REPLY_PRODUCER_CLEANER_BEAN_NAME)) { registry.registerBeanDefinition(INTEGRATION_FLOW_REPLY_PRODUCER_CLEANER_BEAN_NAME, new RootBeanDefinition(IntegrationFlowDefinition.ReplyProducerCleaner.class)); } }

Target:
public void initialize(ConfigurableListableBeanFactory configurableListableBeanFactory) throws BeansException { Assert.isInstanceOf(BeanDefinitionRegistry.class, configurableListableBeanFactory, "To use Spring Integration Java DSL the 'beanFactory' has to be an instance of " + "'BeanDefinitionRegistry'. Consider using 'GenericApplicationContext' implementation." ); BeanDefinitionRegistry registry = (BeanDefinitionRegistry) configurableListableBeanFactory; if (!registry.containsBeanDefinition(INTEGRATION_FLOW_BPP_BEAN_NAME)) { registry.registerBeanDefinition(INTEGRATION_FLOW_BPP_BEAN_NAME, new RootBeanDefinition(IntegrationFlowBeanPostProcessor.class)); registry.registerBeanDefinition(INTEGRATION_FLOW_CONTEXT_BEAN_NAME, new RootBeanDefinition(StandardIntegrationFlowContext.class)); registry.registerBeanDefinition(INTEGRATION_FLOW_REPLY_PRODUCER_CLEANER_BEAN_NAME, new RootBeanDefinition(IntegrationFlowDefinition.ReplyProducerCleaner.class)); } }
Source:
public void canReplaceKeyspace() { CassandraKeyValueServiceConfig newConfig = CassandraKeyValueServiceConfigs.copyWithKeyspace( CONFIG_WITH_KEYSPACE, KEYSPACE); assertThat(newConfig.getKeyspaceOrThrow()).isEqualTo(KEYSPACE); }

Target:
public void canReplaceKeyspace() { CassandraKeyValueServiceConfig newConfig = CassandraKeyValueServiceConfigs.copyWithKeyspace( CONFIG_WITH_KEYSPACE, KEYSPACE_2); assertThat(newConfig.getKeyspaceOrThrow()).isEqualTo(KEYSPACE_2); }
Source:
protected boolean validateDestStorage() { if (getParameters().getOperation() == ImageOperation.Move) { if (getImage().isShareable()) { if (getStorageDomain().getStorageType().equals(StorageType.GLUSTERFS)) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS, String.format("$%1$s %2$s", "diskAlias", getImage().getDiskAlias())); } } } StorageDomainValidator validator = new StorageDomainValidator(getStorageDomain()); return validate(validator.isDomainExistAndActive()) && validate(validator.domainIsValidDestination()); }

Target:
protected boolean validateDestStorage() { StorageDomainValidator validator = new StorageDomainValidator(getStorageDomain()); if (!validate(validator.isDomainExistAndActive()) || !validate(validator.domainIsValidDestination())) { return false; } if (getParameters().getOperation() == ImageOperation.Move && getImage().isShareable() && getStorageDomain().getStorageType().equals(StorageType.GLUSTERFS)) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_CANT_MOVE_SHAREABLE_DISK_TO_GLUSTERFS, String.format("$%1$s %2$s", "diskAlias", getImage().getDiskAlias())); } return true; }
Source:
public ClaimMapping getClaimMapping(String claimURI) throws UserStoreException { for (ClaimManagerListener listener : UMListenerServiceComponent .getClaimManagerListeners()) { if (!listener.getClaimMapping(claimURI)) { return null; } } if (claimCache.isInvalid()) { this.claimMapping = getClaimMapFromDB(); } if (claimURI != null) { return claimMapping.get(claimURI); } return null; }

Target:
public ClaimMapping getClaimMapping(String claimURI) throws UserStoreException { for (ClaimManagerListener listener : UMListenerServiceComponent .getClaimManagerListeners()) { if (!listener.getClaimMapping(claimURI)) { return null; } } if (claimCache.isInvalid()) { this.claimMapping = getClaimMapFromDB(); } if (claimURI != null) { return claimMapping.get(claimURI); } else { throw new UserStoreException("claimURI value is null."); } }
Source:
public static ProjectBuildType getProjectType(IProject project) { if (isAutoTools(project)) return ProjectBuildType.AUTO_TOOLS; IConfiguration defaultConfiguration = helper_getActiveConfiguration(project); IBuilder builder = defaultConfiguration.getBuilder(); Boolean projIsManaged = builder.isManagedBuildOn(); if (projIsManaged) return ProjectBuildType.MANAGED_MAKEFILE; else return ProjectBuildType.OTHER; }

Target:
public static ProjectBuildType getProjectType(IProject project) { if (isAutoTools(project)) { return ProjectBuildType.AUTO_TOOLS; } IConfiguration defaultConfiguration = helper_getActiveConfiguration(project); IBuilder builder = defaultConfiguration.getBuilder(); Boolean projIsManaged = builder.isManagedBuildOn(); if (projIsManaged) { return ProjectBuildType.MANAGED_MAKEFILE; } else { return ProjectBuildType.OTHER; } }
Source:
public void validate(ServerSideConfiguration config) throws ClusterException, TimeoutException { invokeInternal(messageFactory.validateStoreManager(config), false); }

Target:
public void validate(ServerSideConfiguration config) throws ClusterException { invokeInternal(messageFactory.validateStoreManager(config), false); }