auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public BasicScoreBasedSnippetChooser(boolean scoreOrdered, SnippetWeigher snippetWeigher, int maxSnippetsChecked) { super(); this.scoreOrdered = scoreOrdered; this.maxSnippetsChecked = maxSnippetsChecked; this.snippetWeigher = snippetWeigher; }

Target:
public BasicScoreBasedSnippetChooser(boolean scoreOrdered, SnippetWeigher snippetWeigher, int maxSnippetsChecked) { this.scoreOrdered = scoreOrdered; this.maxSnippetsChecked = maxSnippetsChecked; this.snippetWeigher = snippetWeigher; }
Source:
public void waitForReady() throws InterruptedException { Thread t = Thread.currentThread(); String oldName = t.getName(); try { int retries = 0; while (true) { Thread.sleep(1000 * 10); try { URL url = toAgentListenerURL(first(jenkinsUrls)); if (url == null) { return; } retries++; t.setName(oldName + ": trying " + url + " for " + retries + " times"); HttpURLConnection con = (HttpURLConnection) openURLConnection(url, credentials, proxyCredentials, sslSocketFactory); con.setConnectTimeout(5000); con.setReadTimeout(5000); con.connect(); if (con.getResponseCode() == 200) { return; } LOGGER.log(Level.INFO, "Master isn't ready to talk to us on {0}. Will retry again: response code={1}", new Object[]{url, con.getResponseCode()}); } catch (SocketTimeoutException e) { LOGGER.log(INFO, "Failed to connect to the master. Will retry again: {0} {1}", new String[] { e.getClass().getName(), e.getMessage() }); } catch (IOException e) { LOGGER.log(INFO, "Failed to connect to the master. Will retry again", e); } } } finally { t.setName(oldName); } }

Target:
public void waitForReady() throws InterruptedException { Thread t = Thread.currentThread(); String oldName = t.getName(); try { int retries = 0; while (true) { Thread.sleep(1000 * 10); try { URL url = toAgentListenerURL(first(jenkinsUrls)); if (url == null) { return; } retries++; t.setName(oldName + ": trying " + url + " for " + retries + " times"); HttpURLConnection con = (HttpURLConnection) openURLConnection(url, credentials, proxyCredentials, sslSocketFactory); con.setConnectTimeout(5000); con.setReadTimeout(5000); con.connect(); if (con.getResponseCode() == 200) { return; } LOGGER.log(Level.INFO, "Master isn''t ready to talk to us on {0}. Will try again: response code={1}", new Object[]{url, con.getResponseCode()}); } catch (SocketTimeoutException | ConnectException | NoRouteToHostException e) { LOGGER.log(INFO, "Failed to connect to the master. Will try again: {0} {1}", new String[] { e.getClass().getName(), e.getMessage() }); } catch (IOException e) { LOGGER.log(INFO, "Failed to connect to the master. Will try again", e); } } } finally { t.setName(oldName); } }
Source:
private boolean isPlatformExtern(CompilerInput symbolInput) { String name = symbolInput.getName(); name = name.replace("externs.zip return name.startsWith("javascript/externs") || name.startsWith("es") || name.startsWith("w3c") || name.startsWith("ie_") || name.startsWith("browser"); }

Target:
private boolean isPlatformExtern(CompilerInput symbolInput) { String name = symbolInput.getName(); name = name.replace("externs.zip return name.startsWith("javascript/externs/") || name.startsWith("es") || name.startsWith("w3c") || name.startsWith("ie_") || name.startsWith("browser"); }
Source:
private Iterator<?> createIteratorForCascadedValue(Type type, Object value, ValueContext<?, ?> valueContext) { Iterator<?> iter; if ( ReflectionHelper.isIterable( type ) ) { iter = ( (Iterable<?>) value ).iterator(); valueContext.markCurrentPropertyAsIterable(); } else if ( ReflectionHelper.isMap( type ) ) { Map<?, ?> map = (Map<?, ?>) value; iter = map.entrySet().iterator(); valueContext.markCurrentPropertyAsIterable(); } else if ( TypeHelper.isArray( type ) ) { List<?> arrayList = Arrays.asList( (Object[]) value ); iter = arrayList.iterator(); valueContext.markCurrentPropertyAsIterable(); } else { List<Object> list = newArrayList(); list.add( value ); iter = list.iterator(); } return iter; }

Target:
private Iterator<?> createIteratorForCascadedValue(Type type, Object value, ValueContext<?, ?> valueContext) { Iterator<?> iter; if ( ReflectionHelper.isIterable( type ) ) { iter = ( (Iterable<?>) value ).iterator(); valueContext.markCurrentPropertyAsIterable(); } else if ( ReflectionHelper.isMap( type ) ) { Map<?, ?> map = (Map<?, ?>) value; iter = map.entrySet().iterator(); valueContext.markCurrentPropertyAsIterable(); } else if ( TypeHelper.isArray( type ) ) { List<?> arrayList = Arrays.asList( (Object[]) value ); iter = arrayList.iterator(); valueContext.markCurrentPropertyAsIterable(); } else { iter = Collections.singletonList( value ).iterator(); } return iter; }
Source:
public void verifyFixPositionOfSmartBanner(PerformTouchAction touchAction) { int firstPosition = smartBanner.getLocation().getY(); touchAction.swipeFromPointToPoint(50, 90, 50, 40, 500, 3000); int secondPosition = smartBanner.getLocation().getY(); if (firstPosition == secondPosition) { PageObjectLogging.log("verifyFixPositionOfSmartBanner", "Smart banner is fixed", true); } else { PageObjectLogging.log("verifyFixPositionOfSmartBanner", "Smart banner is floating", false); } }

Target:
public void verifyFixPositionOfSmartBanner(PerformTouchAction touchAction) { int lastPosition = smartBanner.getLocation().getY(); touchAction.swipeFromPointToPoint(50, 90, 50, 40, 500, 3000); if (lastPosition == smartBanner.getLocation().getY()) { PageObjectLogging.log("verifyFixPositionOfSmartBanner", "Smart banner is fixed", true); } else { PageObjectLogging.log("verifyFixPositionOfSmartBanner", "Smart banner is floating", false); } }
Source:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } TexParserResult result = (TexParserResult) o; return fileList.equals(result.fileList) && nestedFiles.equals(result.nestedFiles) && citations.equals(result.citations); }

Target:
public boolean equals(Object o) { if (this == o) { return true; } if (o == null || getClass() != o.getClass()) { return false; } TexParserResult that = (TexParserResult) o; return Objects.equals(fileList, that.fileList) && Objects.equals(nestedFiles, that.nestedFiles) && Objects.equals(citations, that.citations); }
Source:
public static CommandContext getCommandContext(String address, int port, InputStream in, OutputStream out, int connectionTimeout) throws CliInitializationException { System.setProperty("aesh.terminal","org.jboss.aesh.terminal.TestTerminal"); setJBossCliConfig(); return CommandContextFactory.getInstance().newCommandContext(new CommandContextConfiguration.Builder() .setController(address + ":" + port) .setUsername(isRemote ? username : null) .setPassword(isRemote ? password.toCharArray() : null) .setConsoleInput(in) .setConsoleOutput(out) .setDisableLocalAuth(false) .setInitConsole(false) .setConnectionTimeout(TimeoutUtil.adjust(connectionTimeout)) .build()); }

Target:
public static CommandContext getCommandContext(String address, int port, InputStream in, OutputStream out, int connectionTimeout) throws CliInitializationException { System.setProperty("aesh.terminal","org.jboss.aesh.terminal.TestTerminal"); setJBossCliConfig(); return CommandContextFactory.getInstance().newCommandContext(new CommandContextConfiguration.Builder() .setController(address + ":" + port) .setUsername(isRemote ? username : null) .setPassword(isRemote ? password.toCharArray() : null) .setConsoleInput(in) .setConsoleOutput(out) .setDisableLocalAuth(false) .setInitConsole(false) .setConnectionTimeout(connectionTimeout) .build()); }
Source:
public DecayTDigest(double compression, double alpha, Ticker ticker) { digest = new TDigest(compression); this.alpha = alpha; this.ticker = ticker; landmarkInSeconds = TimeUnit.NANOSECONDS.toSeconds(ticker.read()); }

Target:
DecayTDigest(double compression, double alpha, Ticker ticker) { digest = new TDigest(compression); this.alpha = alpha; this.ticker = ticker; landmarkInSeconds = TimeUnit.NANOSECONDS.toSeconds(ticker.read()); }
Source:
private String getAcbNamesAsCommaSeparatedList(JobExecutionContext jobContext) { if (Objects.nonNull(jobContext.getMergedJobDataMap().getString("acb"))) { return Arrays.asList(jobContext.getMergedJobDataMap().getString("acb").split("\u263A")).stream() .map(acbId -> { try { return certificationBodyDAO.getById(Long.parseLong(acbId)).getName(); } catch (NumberFormatException | EntityRetrievalException e) { LOGGER.error("Could not retreive ACB name based on value: " + acbId, e); return ""; } }) .collect(Collectors.joining(", ")); } else { return ""; } }

Target:
private String getAcbNamesAsCommaSeparatedList(JobExecutionContext jobContext) { if (Objects.nonNull(jobContext.getMergedJobDataMap().getString("acb"))) { return Arrays.asList( jobContext.getMergedJobDataMap().getString("acb").split(SchedulerManager.DATA_DELIMITER)).stream() .map(acbId -> { try { return certificationBodyDAO.getById(Long.parseLong(acbId)).getName(); } catch (NumberFormatException | EntityRetrievalException e) { LOGGER.error("Could not retreive ACB name based on value: " + acbId, e); return ""; } }) .collect(Collectors.joining(", ")); } else { return ""; } }
Source:
private List getTokenizedList(String value) { List<Object> tokenizedList = new ArrayList<>(); char[] charArray = value.trim().toCharArray(); StringBuffer currentToken = new StringBuffer(""); boolean isCurrentTokenNumeric = false; for (int i = 0; i < charArray.length; i++) { char c = charArray[i]; boolean hasPrevChar = i > 0; boolean hasNextChar = i < charArray.length - 1; if (Character.isDigit(c) || (c == '.' && hasNextChar && Character.isDigit(charArray[i + 1])) || (c == ',' && hasNextChar && hasPrevChar && Character.isDigit(charArray[i - 1]) && Character.isDigit(charArray[i + 1])) || (c == '-' && !hasPrevChar && hasNextChar && Character.isDigit(charArray[i + 1]))) { if (!isCurrentTokenNumeric) { tokenizedList.add(currentToken.toString()); currentToken = new StringBuffer(""); } if (c != ',') { currentToken.append(c); } isCurrentTokenNumeric = true; } else { if (isCurrentTokenNumeric) { try { tokenizedList.add(new BigDecimal(currentToken.toString())); } catch (NumberFormatException nfe) { tokenizedList.add(currentToken.toString()); } currentToken = new StringBuffer(""); } currentToken.append(c); isCurrentTokenNumeric = false; } } if (isCurrentTokenNumeric) { try { tokenizedList.add(new BigDecimal(currentToken.toString())); } catch (NumberFormatException nfe) { tokenizedList.add(currentToken.toString()); } } else { tokenizedList.add(currentToken.toString()); } return tokenizedList; }

Target:
private List<Object> getTokenizedList(String value) { List<Object> tokenizedList = new ArrayList<>(); char[] charArray = value.trim().toCharArray(); StringBuffer currentToken = new StringBuffer(""); boolean isCurrentTokenNumeric = false; for (int i = 0; i < charArray.length; i++) { char c = charArray[i]; boolean hasPrevChar = i > 0; boolean hasNextChar = i < charArray.length - 1; if (Character.isDigit(c) || (c == '.' && hasNextChar && Character.isDigit(charArray[i + 1])) || (c == ',' && hasNextChar && hasPrevChar && Character.isDigit(charArray[i - 1]) && Character.isDigit(charArray[i + 1])) || (c == '-' && !hasPrevChar && hasNextChar && Character.isDigit(charArray[i + 1]))) { if (!isCurrentTokenNumeric) { tokenizedList.add(currentToken.toString()); currentToken = new StringBuffer(""); } if (c != ',') { currentToken.append(c); } isCurrentTokenNumeric = true; } else { if (isCurrentTokenNumeric) { try { tokenizedList.add(new BigDecimal(currentToken.toString())); } catch (NumberFormatException nfe) { tokenizedList.add(currentToken.toString()); } currentToken = new StringBuffer(""); } currentToken.append(c); isCurrentTokenNumeric = false; } } if (isCurrentTokenNumeric) { try { tokenizedList.add(new BigDecimal(currentToken.toString())); } catch (NumberFormatException nfe) { tokenizedList.add(currentToken.toString()); } } else { tokenizedList.add(currentToken.toString()); } return tokenizedList; }
Source:
public RunConditionCheckResult() { mBlockReasons = Collections.emptyList(); mShouldRun = true; }

Target:
private RunConditionCheckResult() { this(Collections.emptyList()); }
Source:
private static Issue parseLine(String line) { if (line.length() > 0) { if (!isDetail(line)) { Matcher m = DEFAULT_PATTERN.matcher(line); if (m.matches()) { String filePath = m.group(1); int lineNumber = Integer.parseInt(m.group(2)); int columnNumber = Integer.parseInt(m.group(3)); String ruleKey = m.group(4); String message = m.group(5); return new Issue(filePath, ruleKey, message, lineNumber, columnNumber); } m = PYLINT_PATTERN.matcher(line); if (m.matches()) { String filePath = m.group(1); int lineNumber = Integer.parseInt(m.group(2)); String ruleKey = m.group(3); String message = m.group(4); return new Issue(filePath, ruleKey, message, lineNumber, 0); } LOG.debug("Cannot parse the line: {}", line); } else { LOG.trace("Classifying as detail and ignoring line '{}'", line); } } return null; }

Target:
private static Issue parseLine(String line) { if (line.length() > 0) { if (!startsWithWhitespace(line)) { Matcher m = DEFAULT_PATTERN.matcher(line); if (m.matches()) { String filePath = m.group(1); int lineNumber = Integer.parseInt(m.group(2)); int columnNumber = Integer.parseInt(m.group(3)); String ruleKey = m.group(4); String message = m.group(5); return new Issue(filePath, ruleKey, message, lineNumber, columnNumber); } m = PYLINT_PATTERN.matcher(line); if (m.matches()) { String filePath = m.group(1); int lineNumber = Integer.parseInt(m.group(2)); String ruleKey = m.group(3); String message = m.group(4); return new Issue(filePath, ruleKey, message, lineNumber, null); } LOG.debug("Cannot parse the line: {}", line); } else { LOG.debug("Classifying as detail and ignoring line '{}'", line); } } return null; }
Source:
public FeatureVector[] classify(Object[] examples) { if (!(examples instanceof Word[])) { String type = examples == null ? "null" : examples.getClass().getName(); logger.error("Classifier 'Forms(Word)' defined on line 20 of CommonFeatures.lbj received '" + type + "' as input."); new Exception().printStackTrace(); System.exit(1); } return super.classify(examples); }

Target:
public FeatureVector[] classify(Object[] examples) { if (!(examples instanceof Word[])) { String type = examples == null ? "null" : examples.getClass().getName(); System.err.println("Classifier 'Forms(Word)' defined on line 20 of CommonFeatures.lbj received '" + type + "' as input."); new Exception().printStackTrace(); System.exit(1); } return super.classify(examples); }
Source:
public void turnCryptoOnInSiteConfig() { SiteConfiguration.clearInstance(); SiteConfiguration siteConfig = SiteConfiguration.getInstance(); siteConfig.set(Property.INSTANCE_CRYPTO_SERVICE, AESCryptoService.class.getName()); siteConfig.set("instance.crypto.opts.kekId", "file:/ siteConfig.set("instance.crypto.opts.keyManager", "uri"); CryptoServiceFactory.resetInstance(); }

Target:
public void turnCryptoOnInSiteConfig() { SiteConfiguration.clearInstance(); SiteConfiguration siteConfig = SiteConfiguration.create(); siteConfig.set(Property.INSTANCE_CRYPTO_SERVICE, AESCryptoService.class.getName()); siteConfig.set("instance.crypto.opts.kekId", "file:/ siteConfig.set("instance.crypto.opts.keyManager", "uri"); CryptoServiceFactory.resetInstance(); }
Source:
public int getDeviceOutputValue(String token, DSID dSID, String dSUID, String name, Short offset) { if (checkRequiredDevice(dSID, dSUID, name) && convertShortToString(offset) != null) { try { String response = transport.execute(SimpleRequestBuilder.buildNewRequest(InterfaceKeys.JSON) .addRequestClass(ClassKeys.DEVICE).addFunction(FunctionKeys.GET_OUTPUT_VALUE) .addParameter(ParameterKeys.TOKEN, token).addParameter(ParameterKeys.DSID, getDsidString(dSID)) .addParameter(ParameterKeys.DSUID, dSUID).addParameter(ParameterKeys.NAME, name) .addParameter(ParameterKeys.OFFSET, convertShortToString(offset)).buildRequestString()); JsonObject responseObj = JSONResponseHandler.toJsonObject(response); if (JSONResponseHandler.checkResponse(responseObj)) { JsonObject valueObject = JSONResponseHandler.getResultJsonObject(responseObj); if (checkBlankField(valueObject, JSONApiResponseKeysEnum.VALUE.getKey())) { return valueObject.get(JSONApiResponseKeysEnum.VALUE.getKey()).getAsInt(); } } } catch (Exception e) { logger.debug("An exception occurred", e); } } return -1; }

Target:
public int getDeviceOutputValue(String token, DSID dSID, String dSUID, String name, Short offset) { if (checkRequiredDevice(dSID, dSUID, name) && SimpleRequestBuilder.objectToString(offset) != null) { String response = transport.execute(SimpleRequestBuilder.buildNewRequest(InterfaceKeys.JSON) .addRequestClass(ClassKeys.DEVICE).addFunction(FunctionKeys.GET_OUTPUT_VALUE) .addDefaultDeviceParameter(token, dSID, dSUID, name) .addParameter(ParameterKeys.OFFSET, SimpleRequestBuilder.objectToString(offset)) .buildRequestString()); JsonObject responseObj = JSONResponseHandler.toJsonObject(response); if (JSONResponseHandler.checkResponse(responseObj)) { JsonObject valueObject = JSONResponseHandler.getResultJsonObject(responseObj); if (checkBlankField(valueObject, JSONApiResponseKeysEnum.VALUE.getKey())) { return valueObject.get(JSONApiResponseKeysEnum.VALUE.getKey()).getAsInt(); } } } return -1; }
Source:
public void run() { long start = System.nanoTime(); try { Path sourceFile = determineCurrentSourceFile(); if ( sourceFile == null ) { log.unableToDetermineCurrentInSourceDirectory(); return; } Path currentDestinationFile = destination.resolve( Integer.valueOf( current ).toString() ); try { if ( FileHelper.areInSync( sourceFile, currentDestinationFile ) ) { log.trace( "Source and destination directory are in sync. No copying required." ); return; } } catch (IOException ioe) { log.unableToCompareSourceWithDestinationDirectory( sourceFile.toString(), currentDestinationFile.toString() ); } int oldIndex = current; int index = oldIndex == 1 ? 2 : 1; Path destinationFile = destination.resolve( Integer.valueOf( index ).toString() ); try { log.tracef( "Copying %s into %s", sourceFile, destinationFile ); FileHelper.synchronize( sourceFile, destinationFile, true, copyChunkSize ); current = index; log.tracef( "Copy for %s took %d ms", indexName, TimeUnit.NANOSECONDS.toMillis( System.nanoTime() - start ) ); } catch (IOException e) { log.unableToSynchronizeSource( indexName, e ); return; } if ( !new File( indexName, "current" + oldIndex ).delete() ) { log.unableToRemovePreviousMarket( indexName ); } try { new File( indexName, "current" + index ).createNewFile(); } catch (IOException e) { log.unableToCreateCurrentMarker( indexName, e ); } } finally { inProgress.set( false ); } }

Target:
public void run() { long start = System.nanoTime(); try { Path sourceFile = determineCurrentSourceFile(); if ( sourceFile == null ) { log.unableToDetermineCurrentInSourceDirectory(); return; } Path currentDestinationFile = destination.resolve( Integer.valueOf( current ).toString() ); try { if ( FileHelper.areInSync( sourceFile, currentDestinationFile ) ) { log.trace( "Source and destination directory are in sync. No copying required." ); return; } } catch (IOException ioe) { log.unableToCompareSourceWithDestinationDirectory( sourceFile.toString(), currentDestinationFile.toString() ); } int oldIndex = current; int index = oldIndex == 1 ? 2 : 1; Path destinationFile = destination.resolve( Integer.valueOf( index ).toString() ); try { log.tracef( "Copying %s into %s", sourceFile, destinationFile ); FileHelper.synchronize( sourceFile, destinationFile, true ); current = index; log.tracef( "Copy for %s took %d ms", indexDir, TimeUnit.NANOSECONDS.toMillis( System.nanoTime() - start ) ); } catch (IOException e) { log.unableToSynchronizeSource( indexDir.toString(), e ); return; } try { Files.delete( indexDir.resolve( "current" + oldIndex ) ); } catch (IOException e) { log.unableToRemovePreviousMarker( indexDir.toString(), e ); } try { Files.createFile( indexDir.resolve( "current" + index ) ); } catch (IOException e) { log.unableToCreateCurrentMarker( indexDir.toString(), e ); } } finally { inProgress.set( false ); } }
Source:
public void saveSystem(final IFile targetFile) { long time1 = System.currentTimeMillis(); if (null != getWriter()) { try { createNamedElementEntry(system, LibraryElementTags.SYSTEM); addIdentification(system); addVersionInfo(system); addApplications(); SystemConfiguration systemConfiguration = system.getSystemConfiguration(); if (null != systemConfiguration) { addDevices(systemConfiguration.getDevices()); addMapping(); addSegment(systemConfiguration.getSegments()); addLink(systemConfiguration.getLinks()); } addEndElement(); } catch (XMLStreamException e) { Activator.getDefault().logError(e.getMessage(), e); } writeToFile(targetFile); } long time2 = System.currentTimeMillis(); System.out.println("Overall Saving time for System (" + system.getName() + ": " + (time2 - time1) + " ms"); }

Target:
public void saveSystem(final IFile targetFile) { long startTime = System.currentTimeMillis(); if (null != getWriter()) { try { createNamedElementEntry(system, LibraryElementTags.SYSTEM); addIdentification(system); addVersionInfo(system); addApplications(); SystemConfiguration systemConfiguration = system.getSystemConfiguration(); if (null != systemConfiguration) { addDevices(systemConfiguration.getDevices()); addMapping(); addSegment(systemConfiguration.getSegments()); addLink(systemConfiguration.getLinks()); } addEndElement(); } catch (XMLStreamException e) { Activator.getDefault().logError(e.getMessage(), e); } writeToFile(targetFile); } long endTime = System.currentTimeMillis(); System.out.println("Overall Saving time for System (" + system.getName() + ": " + (endTime - startTime) + " ms"); }
Source:
public void testCreateReusableSubprocessTaskExecutionSet_case() { final String SLA_DUE_DATE = "12/25/1983"; String uuid = UUID.randomUUID().toString(); CallActivity callActivity = bpmn2.createCallActivity(); callActivity.setId(uuid); CustomElement.isCase.of(callActivity).set(Boolean.TRUE); CustomElement.slaDueDate.of(callActivity).set(SLA_DUE_DATE); CallActivityPropertyReader propertyReader = new CallActivityPropertyReader(callActivity, definitionResolver.getDiagram(), definitionResolver); BaseReusableSubprocessTaskExecutionSet result = tested.createReusableSubprocessTaskExecutionSet(callActivity, propertyReader); assertTrue(CaseReusableSubprocessTaskExecutionSet.class.isInstance(result)); assertTrue(result.getIsCase().getValue()); assertTrue(result.getSlaDueDate().getValue().contains(SLA_DUE_DATE)); }

Target:
public void testCreateReusableSubprocessTaskExecutionSet_case() { CallActivity callActivity = bpmn2.createCallActivity(); CustomElement.isCase.of(callActivity).set(Boolean.TRUE); CustomElement.slaDueDate.of(callActivity).set(SLA_DUE_DATE); CallActivityPropertyReader propertyReader = new CallActivityPropertyReader(callActivity, definitionResolver.getDiagram(), definitionResolver); BaseReusableSubprocessTaskExecutionSet result = tested.createReusableSubprocessTaskExecutionSet(callActivity, propertyReader); assertTrue(CaseReusableSubprocessTaskExecutionSet.class.isInstance(result)); assertTrue(result.getIsCase().getValue()); assertTrue(result.getSlaDueDate().getValue().contains(SLA_DUE_DATE)); }
Source:
public Activator() { System.out.println("Starting 1"); }

Target:
public Activator() { }
Source:
public IWallet createWallet(String walletLogin) { System.out.println("wallet login:" + walletLogin); if (walletLogin !=null && !walletLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(walletLogin,":"); String walletType = st.nextToken(); System.out.println("walletType:" + walletType); if ("aeternity".equalsIgnoreCase(walletType)) { String mnemonic = st.hasMoreTokens() ? st.nextToken() : null; return new AeternityWallet(mnemonic); } } return null; }

Target:
public IWallet createWallet(String walletLogin) { if (walletLogin !=null && !walletLogin.trim().isEmpty()) { StringTokenizer st = new StringTokenizer(walletLogin,":"); String walletType = st.nextToken(); if ("aeternity".equalsIgnoreCase(walletType)) { String mnemonicsOrPrivKey = st.hasMoreTokens() ? st.nextToken() : null; return new AeternityWallet(mnemonicsOrPrivKey); } } return null; }
Source:
protected String checkAddDropWhitelist(final CatalogType suspect, final ChangeType changeType) { if (ChangeType.ADDITION == changeType && suspect instanceof Table) { assert ((Boolean)suspect.getField("isDRed")); return "Missing DR table " + suspect.getTypeName() + " on replica cluster"; } if (ChangeType.DELETION == changeType && suspect instanceof Table && isXDCR()) { assert ((Boolean)suspect.getField("isDRed")); return "Missing DR table " + suspect.getTypeName() + " on master cluster"; } if (suspect instanceof Column || isUniqueIndex(suspect) || isUniqueIndexColumn(suspect)) { return "Missing " + suspect + " from " + suspect.getParent() + " on " + (ChangeType.ADDITION == changeType ? "replica" : "master"); } return null; }

Target:
protected String checkAddDropWhitelist(final CatalogType suspect, final ChangeType changeType) { if (ChangeType.ADDITION == changeType && suspect instanceof Table) { assert ((Boolean)suspect.getField("isDRed")); return "Missing DR table " + suspect.getTypeName() + " on local cluster"; } if (ChangeType.DELETION == changeType && suspect instanceof Table && m_isXDCR) { assert ((Boolean)suspect.getField("isDRed")); return "Missing DR table " + suspect.getTypeName() + " on remote cluster " + m_remoteClusterId; } if (suspect instanceof Column || isUniqueIndex(suspect) || isUniqueIndexColumn(suspect)) { return "Missing " + suspect + " from " + suspect.getParent() + " on " + (ChangeType.ADDITION == changeType ? "local cluster" : "remote cluster " + m_remoteClusterId); } return null; }
Source:
public void testOctagonQuery() { OGCGeometryWrapper octagonA = new OGCGeometryWrapper(POLYGON_A); OGCGeometryWrapper octagonB = new OGCGeometryWrapper(POLYGON_B); OGCGeometryWrapper pointX = new OGCGeometryWrapper(POINT_X); OGCGeometryWrapper pointY = new OGCGeometryWrapper(POINT_Y); OGCGeometryWrapper pointZ = new OGCGeometryWrapper(POINT_Z); OGCGeometryWrapper pointW = new OGCGeometryWrapper(POINT_W); Flatbush rtree = new Flatbush<OGCGeometryWrapper>(new OGCGeometryWrapper[] { pointX, pointY, pointZ, pointW }); List<OGCGeometryWrapper> resultsA = rtree.findIntersections(octagonA.getExtent()); resultsA.sort(Comparator.naturalOrder()); assertEquals(resultsA, Arrays.asList(pointX, pointY)); List<OGCGeometryWrapper> resultsB = rtree.findIntersections(octagonB.getExtent()); resultsB.sort(Comparator.naturalOrder()); assertEquals(resultsB, Arrays.asList(pointY, pointZ)); }

Target:
public void testOctagonQuery() { OGCGeometryWrapper octagonA = new OGCGeometryWrapper(POLYGON_A); OGCGeometryWrapper octagonB = new OGCGeometryWrapper(POLYGON_B); OGCGeometryWrapper pointX = new OGCGeometryWrapper(POINT_X); OGCGeometryWrapper pointY = new OGCGeometryWrapper(POINT_Y); OGCGeometryWrapper pointZ = new OGCGeometryWrapper(POINT_Z); OGCGeometryWrapper pointW = new OGCGeometryWrapper(POINT_W); Flatbush<OGCGeometryWrapper> rtree = new Flatbush<>(new OGCGeometryWrapper[] {pointX, pointY, pointZ, pointW}); List<OGCGeometryWrapper> resultsA = findIntersections(rtree, octagonA.getExtent()); assertEqualsSorted(resultsA, ImmutableList.of(pointX, pointY), Comparator.naturalOrder()); List<OGCGeometryWrapper> resultsB = findIntersections(rtree, octagonB.getExtent()); assertEqualsSorted(resultsB, ImmutableList.of(pointY, pointZ), Comparator.naturalOrder()); }
Source:
public Disk mapRow(ResultSet rs, int rowNum) throws SQLException { DiskImage disk = new DiskImage(); disk.setDiskAlias(rs.getString("disk_alias")); disk.setSize(rs.getLong("size")); disk.setId(new Guid((UUID) rs.getObject("disk_id"))); return disk; }

Target:
public Disk mapRow(ResultSet rs, int rowNum) throws SQLException { DiskImage disk = new DiskImage(); disk.setDiskAlias(rs.getString("disk_alias")); disk.setSize(rs.getLong("size")); disk.setId(getGuid(rs, "disk_id")); return disk; }
Source:
void expandOrCollapseSubTypes() { final HTMLElement arrow = view.getArrow(); if (isCollapsed(arrow)) { CssHelper.asDownArrow(arrow); expandSubDataTypes(getDataType()); } else { CssHelper.asRightArrow(arrow); collapseSubDataTypes(getDataType()); } }

Target:
void expandOrCollapseSubTypes() { if (view.isCollapsed()) { view.expand(); } else { view.collapse(); } }
Source:
public static String get(Property property) { if (config.containsKey(property.getKey())) { return config.get(property.getKey()); } return null; }

Target:
public static String get(Property property) { return config.get(property.getKey()); }
Source:
protected Image getImage(Object element, int columnIndex) { switch(columnIndex) { case PACKAGE_ELEMENT_COLUMN_INDEX: return umlLabelProvider.getImage(element); case PROFILE_APPLICATION_NAME_COLUMN_INDEX: if(element instanceof Profile) { return umlLabelProvider.getImage(element); } default: return null; } }

Target:
protected Image getImage(Object element, int columnIndex) { switch(columnIndex) { case PACKAGE_ELEMENT_COLUMN_INDEX: return umlLabelProvider.getImage(element); case PROFILE_APPLICATION_NAME_COLUMN_INDEX: if(element instanceof ProfileApplication) { return umlLabelProvider.getImage(element); } default: return null; } }
Source:
ExecutionPlan getExecutionPlan(String runId) { Map<String, String> allowedUserConfig = new HashMap<>(userConfig); Map<String, String> generatedConfig = new HashMap<>(); if (!LegacyTaskApplication.class.isAssignableFrom(appDesc.getAppClass())) { if (userConfig.containsKey(TaskConfig.INPUT_STREAMS())) { LOG.warn("SamzaApplications should not specify task.inputs in configuration. " + "Ignoring configured value of " + userConfig.get(TaskConfig.INPUT_STREAMS())); allowedUserConfig.remove(TaskConfig.INPUT_STREAMS()); } generatedConfig.putAll(getGeneratedConfig(runId)); } Config mergedConfig = JobNodeConfigurationGenerator.mergeConfig(allowedUserConfig, generatedConfig); StreamManager streamManager = buildAndStartStreamManager(mergedConfig); try { ExecutionPlanner planner = new ExecutionPlanner(mergedConfig, streamManager); return planner.plan(appDesc); } finally { streamManager.stop(); } }

Target:
ExecutionPlan getExecutionPlan(String runId) { Map<String, String> allowedUserConfig = new HashMap<>(userConfig); Map<String, String> generatedConfig = new HashMap<>(); if (!LegacyTaskApplication.class.isAssignableFrom(appDesc.getAppClass())) { if (userConfig.containsKey(TaskConfig.INPUT_STREAMS())) { LOG.warn("SamzaApplications should not specify task.inputs in configuration. " + "Specify them using InputDescriptors instead. Ignoring configured task.inputs value of " + userConfig.get(TaskConfig.INPUT_STREAMS())); allowedUserConfig.remove(TaskConfig.INPUT_STREAMS()); } generatedConfig.putAll(getGeneratedConfig(runId)); } Config mergedConfig = JobNodeConfigurationGenerator.mergeConfig(allowedUserConfig, generatedConfig); StreamManager streamManager = buildAndStartStreamManager(mergedConfig); try { ExecutionPlanner planner = new ExecutionPlanner(mergedConfig, streamManager); return planner.plan(appDesc); } finally { streamManager.stop(); } }
Source:
public boolean applicable(Context context) { TypeMirror autoValueClass = context.autoValueClass().asType(); if (!needsCreator(context)) { context.processingEnvironment().getMessager().printMessage(Diagnostic.Kind.ERROR, "Manual implementation of a static Parcelable.Creator<T> CREATOR field found when processing " + autoValueClass.toString() + ". Remove this so auto-value-parcel can automatically generate the " + "implementation for you."); return false; } if (!needsWriteToParcel(context)) { context.processingEnvironment().getMessager().printMessage(Diagnostic.Kind.ERROR, "Manual implementation of Parcelable#writeToParcel(Parcel,int) found when processing " + autoValueClass.toString() + ". Remove this so auto-value-parcel can automatically generate the " + "implementation for you."); return false; } TypeMirror parcelable = context.processingEnvironment().getElementUtils() .getTypeElement("android.os.Parcelable").asType(); return TypeSimplifier.isClassOfType(context.processingEnvironment().getTypeUtils(), parcelable, autoValueClass); }

Target:
public boolean applicable(Context context) { TypeMirror autoValueClass = context.autoValueClass().asType(); VariableElement creator = findCreator(context); if (creator != null) { context.processingEnvironment().getMessager().printMessage(Diagnostic.Kind.ERROR, "Manual implementation of a static Parcelable.Creator<T> CREATOR field found when processing " + autoValueClass.toString() + ". Remove this so auto-value-parcel can automatically generate the " + "implementation for you.", creator); } ExecutableElement writeToParcel = findWriteToParcel(context); if (writeToParcel != null) { context.processingEnvironment().getMessager().printMessage(Diagnostic.Kind.ERROR, "Manual implementation of Parcelable#writeToParcel(Parcel,int) found when processing " + autoValueClass.toString() + ". Remove this so auto-value-parcel can automatically generate the " + "implementation for you.", writeToParcel); } TypeMirror parcelable = context.processingEnvironment().getElementUtils() .getTypeElement("android.os.Parcelable").asType(); return TypeSimplifier.isClassOfType(context.processingEnvironment().getTypeUtils(), parcelable, autoValueClass); }
Source:
public void findAll() throws Exception { Object operatorID1 = repository.create(new NewOperator("name1", OperatorState.ACTIVE, "description1", "domainName1", "friendlyName1", "emergencyNumber1")); Object operatorID2 = repository.create(new NewOperator("name2", OperatorState.INACTIVE, "description2", "domainName2", "friendlyName2", "emergencyNumber2")); List<Operator> got = repository.findAll(); List<Operator> want = Lists.newArrayList( new Operator(new ID(operatorID1), "name1", OperatorState.ACTIVE, "description1", "domainName1", "friendlyName1", "emergencyNumber1"), new Operator(new ID(operatorID2), "name2", OperatorState.INACTIVE, "description2", "domainName2", "friendlyName2", "emergencyNumber2") ); assertThat(got, deepEquals(want)); }

Target:
public void findAll() throws Exception { Object id1 = repository.create(new NewOperator("name1", OperatorState.ACTIVE, "description1", "domainName1", "friendlyName1", "emergencyNumber1")); Object id2 = repository.create(new NewOperator("name2", OperatorState.INACTIVE, "description2", "domainName2", "friendlyName2", "emergencyNumber2")); List<Operator> got = repository.findAll(); List<Operator> want = Lists.newArrayList( new Operator(new ID(id1), "name1", OperatorState.ACTIVE, "description1", "domainName1", "friendlyName1", "emergencyNumber1"), new Operator(new ID(id2), "name2", OperatorState.INACTIVE, "description2", "domainName2", "friendlyName2", "emergencyNumber2") ); assertThat(got, deepEquals(want)); }
Source:
public void testRebindAfterItemDeprecated() { String yaml = "name: rebind-yaml-catalog-item-test\n" + "brooklyn.catalog:\n" + " version: " + TEST_VERSION + "\n" + "services:\n" + "- type: io.camp.mock:AppServer"; BasicBrooklynCatalog catalog = (BasicBrooklynCatalog) origManagementContext.getCatalog(); CatalogItem<?, ?> catalogItem = catalog.addItem(yaml); assertNotNull(catalogItem, "catalogItem"); catalogItem.setDeprecated(true); rebindAndAssertCatalogsAreEqual(); CatalogItem<?, ?> catalogItemAfterRebind = catalog.getCatalogItem("rebind-yaml-catalog-item-test", TEST_VERSION); assertTrue(catalogItemAfterRebind.isDeprecated(), "Expected item to be deprecated"); }

Target:
public void testRebindAfterItemDeprecated() { String yaml = "name: rebind-yaml-catalog-item-test\n" + "brooklyn.catalog:\n" + " version: " + TEST_VERSION + "\n" + "services:\n" + "- type: io.camp.mock:AppServer"; BasicBrooklynCatalog catalog = (BasicBrooklynCatalog) origManagementContext.getCatalog(); CatalogItem<?, ?> catalogItem = catalog.addItem(yaml); assertNotNull(catalogItem, "catalogItem"); catalogItem.setDeprecated(true); catalog.persist(catalogItem); rebindAndAssertCatalogsAreEqual(); CatalogItem<?, ?> catalogItemAfterRebind = newManagementContext.getCatalog().getCatalogItem("rebind-yaml-catalog-item-test", TEST_VERSION); assertTrue(catalogItemAfterRebind.isDeprecated(), "Expected item to be deprecated"); }
Source:
public void test_backupOperationAppliesDefaultExpiryPolicy() { SimpleExpiryListener listener = new SimpleExpiryListener(); HazelcastExpiryPolicy defaultExpiryPolicy = new HazelcastExpiryPolicy(FIVE_SECONDS, FIVE_SECONDS, FIVE_SECONDS); CacheConfig cacheConfig = createCacheConfig(defaultExpiryPolicy, listener); ICache cache = createCache(cacheConfig); for (int i = 0; i < 100; i++) { cache.put(i, i); } sleepAtLeastMillis(500); for (int i = 1; i < CLUSTER_SIZE; i++) { BackupAccessor backupAccessor = TestBackupUtils.newCacheAccessor(instances, cache.getName(), i); for (int j = 0; j < 100; j++) { TestBackupUtils.assertExpirationTimeExists(j, backupAccessor); } } getNode(instances[1]).shutdown(true); getNode(instances[2]).shutdown(true); sleepAtLeastMillis(4500); int unExpiredCount = 0; for (int i = 0; i < 100; i++) { if (cache.get(i) != null) { unExpiredCount++; break; } } assertEquals(0, unExpiredCount); assertEqualsEventually(100, listener.expirationCount); }

Target:
public void test_backupOperationAppliesDefaultExpiryPolicy() { SimpleExpiryListener listener = new SimpleExpiryListener(); HazelcastExpiryPolicy defaultExpiryPolicy = new HazelcastExpiryPolicy(FIVE_SECONDS, FIVE_SECONDS, FIVE_SECONDS); CacheConfig cacheConfig = createCacheConfig(defaultExpiryPolicy, listener); ICache cache = createCache(cacheConfig); for (int i = 0; i < 100; i++) { cache.put(i, i); } for (int i = 1; i < CLUSTER_SIZE; i++) { BackupAccessor backupAccessor = TestBackupUtils.newCacheAccessor(instances, cache.getName(), i); for (int j = 0; j < 100; j++) { TestBackupUtils.assertExpirationTimeExistsEventually(j, backupAccessor); } } getNode(instances[1]).shutdown(true); getNode(instances[2]).shutdown(true); sleepAtLeastSeconds(5); int unExpiredCount = 0; for (int i = 0; i < 100; i++) { if (cache.get(i) != null) { unExpiredCount++; break; } } assertEquals(0, unExpiredCount); assertEqualsEventually(100, listener.expirationCount); }
Source:
private static void saveLocks(File locksData) throws IOException { try (ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(locksData))) { out.writeInt(DATA_VERSION); out.writeInt(locks.size()); for (String string : locks) out.writeUTF(string); } }

Target:
private static void saveLocks(File locksData) throws IOException { try (ObjectOutputStream out = new ObjectOutputStream(new FileOutputStream(locksData))) { out.writeInt(DATA_VERSION); out.writeInt(locks.size()); for (String lock : locks) out.writeUTF(lock); } }
Source:
public Credentials getCredentials() throws IOException { if (StringUtils.isNotEmpty(this.jsonPath)) { try { return ServiceAccountCredentials.fromStream(new FileInputStream(jsonPath)); } catch (IOException e) { log.error("Could not import Google Pubsub json credentials: {}", e.getMessage()); } } else { try { return GoogleCredentials.getApplicationDefault(); } catch (IOException e) { log.error("Could not import default application credentials: {}", e.getMessage()); } } throw new IllegalStateException("Unable to authenticate to Google Pubsub."); }

Target:
public Credentials getCredentials() throws IOException { if (StringUtils.isNotEmpty(this.jsonPath)) { try { return ServiceAccountCredentials.fromStream(new FileInputStream(this.jsonPath)); } catch (IOException e) { log.error("Could not import Google Pubsub json credentials: {}", e.getMessage()); } } else { try { return GoogleCredentials.getApplicationDefault(); } catch (IOException e) { log.error("Could not import default application credentials: {}", e.getMessage()); } } throw new IllegalStateException("Unable to authenticate to Google Pubsub."); }
Source:
public String getEndpoint() { String stringToken = jmxConnect.getStorageServiceProxy().getTokens().get(0); Map<String, String> tokenToEndpoint = jmxConnect.getStorageServiceProxy().getTokenToEndpointMap(); for (Map.Entry<String, String> pair : tokenToEndpoint.entrySet()) { if (pair.getKey().equals(stringToken)) { return pair.getValue(); } } throw new RuntimeException("Could not find myself in the endpoint list, something is very wrong! Is the Cassandra node fully started?"); }

Target:
public String getEndpoint() { String stringToken = jmxConnect.getStorageServiceProxy().getTokens().get(0); Map<String, String> tokenToEndpoint = jmxConnect.getStorageServiceProxy().getTokenToEndpointMap(); for (Map.Entry<String, String> pair : tokenToEndpoint.entrySet()) { if (pair.getKey().equals(stringToken)) { return pair.getValue(); } } throw new InconsistentNodeException("Could not find myself in the endpoint list, something is very wrong! Is the Cassandra node fully started?"); }
Source:
public Response purgeCache(String serviceId) { LOG.info("purgeCache() called with serviceId={}", serviceId); Optional<BaragonService> maybeService; if (internalStateCache.containsKey(serviceId)){ maybeService = Optional.of(internalStateCache.get(serviceId).getService()); } else { maybeService = stateDatastore.getService(serviceId); } if (!maybeService.isPresent()){ return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(String.format("Could not find service with serviceId=%s", serviceId)).build(); } String serviceBasePathWithoutLeadingSlash = getServiceBasePathWithoutLeadingSlash( maybeService.get().getServiceBasePath() ); String purgeCacheUri = String.format( baragonAgentConfiguration.getPurgeCacheUriFormat(), serviceBasePathWithoutLeadingSlash ); LOG.info("purgeCache() uri={}", purgeCacheUri); final HttpRequest.Builder builder = HttpRequest.newBuilder() .setUrl(purgeCacheUri) .setMethod(Method.GET); HttpResponse response = this.httpClient.execute(builder.build()); LOG.info("purgeCache() response from loadbalancer={}", response.getAsString()); return Response.status(response.getStatusCode()).entity(response.getAsString()).build(); }

Target:
public Response purgeCache(String serviceId) { LOG.info("purgeCache() called with serviceId={}", serviceId); Optional<BaragonService> maybeService; if (internalStateCache.containsKey(serviceId)){ maybeService = Optional.of(internalStateCache.get(serviceId).getService()); } else { maybeService = stateDatastore.getService(serviceId); } if (!maybeService.isPresent()){ return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(String.format("Could not find service with serviceId=%s", serviceId)).build(); } String purgeCacheUri = String.format( baragonAgentConfiguration.getPurgeCacheUriFormat(), Hashing.sha256() .hashString(maybeService.get().getServiceId(), StandardCharsets.UTF_8) .toString() ); LOG.info("purgeCache() uri={}", purgeCacheUri); final HttpRequest.Builder builder = HttpRequest.newBuilder() .setUrl(purgeCacheUri) .setMethod(Method.POST); try { HttpResponse response = this.httpClient.execute(builder.build()); LOG.info("purgeCache() response from loadbalancer={}", response.getAsString()); return Response.status(response.getStatusCode()).entity(response.getAsString()).build(); } catch (Exception e){ LOG.error("purgeCache() exception, but will not fail", e); return Response.serverError().entity(e.getMessage()).build(); } }
Source:
private ICompletionProposal[] computeProposals(int offset) { try { if (fContentAssistSubjectControl != null) return fContentAssistant.computeCompletionProposals(fContentAssistSubjectControl, offset); return fContentAssistant.computeCompletionProposals(fViewer, offset); } catch (RuntimeException e) { hide(); throw e; } catch (Error e) { hide(); throw e; } }

Target:
private ICompletionProposal[] computeProposals(int offset) { ICompletionProposal[] proposals = null; boolean succeeded = false; try { if (fContentAssistSubjectControl != null) { proposals = fContentAssistant.computeCompletionProposals(fContentAssistSubjectControl, offset); } else { proposals = fContentAssistant.computeCompletionProposals(fViewer, offset); } succeeded = true; } finally { if (!succeeded) { hide(); } } return proposals; }
Source:
private void setAboutThisCourse(String overview) { addDivider(); courseAbout.setVisibility(View.VISIBLE); URLInterceptorWebViewClient client = new URLInterceptorWebViewClient( getActivity(), courseAboutWebView); client.setAllLinksAsExternal(true); StringBuffer buff = new StringBuffer(); buff.append("<head>"); buff.append("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">"); try { String cssFileContent = FileUtil.loadTextFileFromAssets(getActivity(), "css/render-html-in-webview.css"); buff.append("<style>"); buff.append(cssFileContent); buff.append("</style>"); } catch (IOException e) { logger.error(e); } buff.append("</head>"); buff.append("<body>"); buff.append("<div class=\"header\">"); buff.append(overview); buff.append("</div>"); buff.append("</body>"); courseAboutWebView.clearCache(true); courseAboutWebView.loadDataWithBaseURL(environment.getConfig().getApiHostURL(), buff.toString(), "text/html", HTTP.UTF_8, null); }

Target:
private void setAboutThisCourse(String overview) { courseAbout.setVisibility(View.VISIBLE); URLInterceptorWebViewClient client = new URLInterceptorWebViewClient( getActivity(), courseAboutWebView); client.setAllLinksAsExternal(true); StringBuffer buff = new StringBuffer(); buff.append("<head>"); buff.append("<meta name=\"viewport\" content=\"width=device-width, initial-scale=1\">"); try { String cssFileContent = FileUtil.loadTextFileFromAssets(getActivity(), "css/render-html-in-webview.css"); buff.append("<style>"); buff.append(cssFileContent); buff.append("</style>"); } catch (IOException e) { logger.error(e); } buff.append("</head>"); buff.append("<body>"); buff.append("<div class=\"header\">"); buff.append(overview); buff.append("</div>"); buff.append("</body>"); courseAboutWebView.clearCache(true); courseAboutWebView.loadDataWithBaseURL(environment.getConfig().getApiHostURL(), buff.toString(), "text/html", HTTP.UTF_8, null); }
Source:
public static StringComparator makeComparator(String type) { if (type.equals(StringComparators.LEXICOGRAPHIC)) { return lexicographic(); } else if (type.equals(StringComparators.ALPHANUMERIC)) { return alphanumeric(); } else { throw new IAE("Unknown string comparator[%s]", type); } }

Target:
public static StringComparator makeComparator(String type) { if (type.equals(StringComparators.LEXICOGRAPHIC_NAME)) { return LEXICOGRAPHIC; } else if (type.equals(StringComparators.ALPHANUMERIC_NAME)) { return ALPHANUMERIC; } else { throw new IAE("Unknown string comparator[%s]", type); } }
Source:
public void setUp() throws IOException { existingTempFile = File.createTempFile("FiletypeTest.", ".tmp"); existingTempFile.deleteOnExit(); systemTempDir = System.getProperty("java.io.tmpdir"); final File tmpDir = new File(systemTempDir); inMemmoryfileSystem = Jimfs.newFileSystem(Configuration.unix());; if (!tmpDir.isDirectory()) tmpDir.mkdir(); if (!tmpDir.isDirectory()) throw new RuntimeException("java.io.tmpdir (" + systemTempDir + ") is not a directory"); systemUser = System.getProperty("user.name"); }

Target:
public void setUp() throws IOException { existingTempFile = File.createTempFile("FiletypeTest.", ".tmp"); existingTempFile.deleteOnExit(); systemTempDir = System.getProperty("java.io.tmpdir"); final File tmpDir = new File(systemTempDir); inMemoryfileSystem = Jimfs.newFileSystem(Configuration.unix());; if (!tmpDir.isDirectory()) tmpDir.mkdir(); if (!tmpDir.isDirectory()) throw new RuntimeException("java.io.tmpdir (" + systemTempDir + ") is not a directory"); systemUser = System.getProperty("user.name"); }