auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void ipSecConnectSocket(Integer socketFd, String addr, Integer port) { FileDescriptor fd = new FileDescriptor(); fd.setInt$(socketFd.intValue()); try { InetAddress remoteAddr = NetworkUtils.numericToInetAddress(addr); Os.connect(fd, remoteAddr, port.intValue()); } catch (SocketException | ErrnoException e) { Log.e("IpSec: Failed to connect socket " + e.toString()); } }

Target:
public Boolean ipSecConnectSocket(Integer socketFd, String addr, Integer port) { FileDescriptor fd = new FileDescriptor(); fd.setInt$(socketFd.intValue()); try { InetAddress remoteAddr = NetworkUtils.numericToInetAddress(addr); Os.connect(fd, remoteAddr, port.intValue()); return true; } catch (SocketException | ErrnoException e) { Log.e("IpSec: Failed to connect socket " + e.toString()); } return false; }
Source:
private String indexPurposeString() { if (0 <= m_windowFunctionUsesIndex) { return "Window function plan node " + m_windowFunctionUsesIndex; } if (SubPlanAssembler.STATEMENT_LEVEL_ORDER_BY_INDEX == m_windowFunctionUsesIndex) { return "Statement Level Order By"; } if (SubPlanAssembler.NO_INDEX_USE == m_windowFunctionUsesIndex) { return "No Indexing Used"; } assert(false); return ""; }

Target:
private String indexPurposeString() { switch (m_windowFunctionUsesIndex) { case SubPlanAssembler.STATEMENT_LEVEL_ORDER_BY_INDEX: return "Statement Level Order By"; case SubPlanAssembler.NO_INDEX_USE: return "No Indexing Used"; default: if (0 <= m_windowFunctionUsesIndex) { return "Window function plan node " + m_windowFunctionUsesIndex; } } assert(false); return ""; }
Source:
private static <T extends VmBase> void addImportedInterfaces(T entity, List<VmDevice> vmDeviceToUpdate) { final Guid id = entity.getId(); for (VmNetworkInterface iface : entity.getInterfaces()) { Guid deviceId = iface.getId(); VmDevice vmDevice = addManagedDevice(new VmDeviceId(deviceId, id), VmDeviceType.INTERFACE, VmDeviceType.BRIDGE, null, true, false, ""); updateVmDevice(entity, vmDevice, deviceId, vmDeviceToUpdate); } }

Target:
private static <T extends VmBase> void addImportedInterfaces(T entity, List<VmDevice> vmDeviceToUpdate) { final Guid id = entity.getId(); for (VmNetworkInterface iface : entity.getInterfaces()) { Guid deviceId = iface.getId(); VmDevice vmDevice = addManagedDevice(new VmDeviceId(deviceId, id), VmDeviceType.INTERFACE, VmDeviceType.BRIDGE, null, true, false); updateVmDevice(entity, vmDevice, deviceId, vmDeviceToUpdate); } }
Source:
public static String getName(OsmandApplication app, SearchResult searchResult) { switch (searchResult.objectType) { case STREET: if (searchResult.localeName.endsWith(")")) { int i = searchResult.localeName.indexOf('('); if (i > 0) { return searchResult.localeName.substring(0, i).trim(); } } break; case STREET_INTERSECTION: if (!Algorithms.isEmpty(searchResult.localeRelatedObjectName)) { return searchResult.localeName + " - " + searchResult.localeRelatedObjectName; } break; case RECENT_OBJ: HistoryEntry historyEntry = (HistoryEntry) searchResult.object; PointDescription pd = historyEntry.getName(); return pd.getSimpleName(app, false); case LOCATION: LatLon latLon = searchResult.location; return PointDescription.getLocationNamePlain(app, latLon.getLatitude(), latLon.getLongitude()); case FAVORITE: return ((FavouritePoint) searchResult.object).getName(); } return searchResult.localeName; }

Target:
public static String getName(OsmandApplication app, SearchResult searchResult) { switch (searchResult.objectType) { case STREET: if (searchResult.localeName.endsWith(")")) { int i = searchResult.localeName.indexOf('('); if (i > 0) { return searchResult.localeName.substring(0, i).trim(); } } break; case STREET_INTERSECTION: if (!Algorithms.isEmpty(searchResult.localeRelatedObjectName)) { return searchResult.localeName + " - " + searchResult.localeRelatedObjectName; } break; case RECENT_OBJ: HistoryEntry historyEntry = (HistoryEntry) searchResult.object; PointDescription pd = historyEntry.getName(); return pd.getSimpleName(app, false); case LOCATION: LatLon latLon = searchResult.location; return PointDescription.getLocationNamePlain(app, latLon.getLatitude(), latLon.getLongitude()); } return searchResult.localeName; }
Source:
public void onSensorChanged(SensorEvent event) { if (event.sensor.getType() == Sensor.TYPE_PROXIMITY) { if (event.values[0] >= -SENSOR_SENSITIVITY && event.values[0] <= SENSOR_SENSITIVITY) { if (isSensorEnabled()) { unlockEvent(); } } } }

Target:
public void onSensorChanged(SensorEvent event) { if (event.sensor.getType() == Sensor.TYPE_PROXIMITY) { if (event.values[0] >= -SENSOR_SENSITIVITY && event.values[0] <= SENSOR_SENSITIVITY) { unlockEvent(); } } }
Source:
public void testEntitiesBundleInstallsProperly() throws Exception { testEntitiesBundleInstallsProperly(true); outputStream = new FileOutputStream(configurationFile); Properties datanucleusProps = coreConfigurationService.loadDatanucleusConfig(); datanucleusProps.setProperty("datanucleus.cache.level2.type", "none"); datanucleusProps.store(outputStream, null); outputStream.close(); testEntitiesBundleInstallsProperly(false); outputStream = new FileOutputStream(configurationFile); datanucleusProps.remove("datanucleus.cache.level2.type", "none"); datanucleusProps.store(outputStream, null); outputStream.close(); }

Target:
public void testEntitiesBundleInstallsProperly() throws Exception { testEntitiesBundleInstallsProperly(true); setCacheType("none"); testEntitiesBundleInstallsProperly(false); }
Source:
public String toString() { return name; }

Target:
public String toString() { return "EventListenerDescriptor [name=" + name + ", className=" + className + ", isPostCommit=" + isPostCommit + ", isAsync=" + isAsync + "]"; }
Source:
protected boolean canDoAction() { if (getAffinityGroupDao().getByName(getParameters().getAffinityGroup().getName()) != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_AFFINITY_GROUP_NAME_EXSITS); } return validateParameters(); }

Target:
protected boolean canDoAction() { if (getAffinityGroupDao().getByName(getParameters().getAffinityGroup().getName()) != null) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_AFFINITY_GROUP_NAME_EXISTS); } return validateParameters(); }
Source:
public void setName(String name) { fName = name; if (fRoot != null) { if (name != null && name.length() > 0) { fRoot.setAttribute(TargetDefinitionPersistenceHelper.ATTR_NAME, name); } else { fRoot.removeAttribute(TargetDefinitionPersistenceHelper.ATTR_NAME); } } }

Target:
public void setName(String name) { fName = name; if (fRoot != null) { if (name != null && !name.isEmpty()) { fRoot.setAttribute(TargetDefinitionPersistenceHelper.ATTR_NAME, name); } else { fRoot.removeAttribute(TargetDefinitionPersistenceHelper.ATTR_NAME); } } }
Source:
public void onApplicationEvent(ContextClosedEvent event) { if(closed.compareAndSet(false, true)) { afterInitialisation(); try { persistentQueueDAO.shutdown(); } finally { DownloadControlThread nextToCloseRunnable = null; while((nextToCloseRunnable = runningDownloadControlRunnables.poll()) != null) { nextToCloseRunnable.shutdown(); } Thread nextToCloseThread = null; List<Thread> toJoinThreads = new ArrayList<>(); while((nextToCloseThread = runningDownloadControllers.poll()) != null) { if(nextToCloseThread.isAlive()) { nextToCloseThread.interrupt(); toJoinThreads.add(nextToCloseThread); } } for(Thread nextToJoinThread : toJoinThreads) { try { nextToJoinThread.join(5000); } catch(InterruptedException e) { Thread.currentThread().interrupt(); } } } } }

Target:
public void onApplicationEvent(ContextClosedEvent event) { afterInitialisation(); if(closed.compareAndSet(false, true)) { try { persistentQueueDAO.shutdown(); } finally { DownloadControlThread nextToCloseRunnable = null; while((nextToCloseRunnable = runningDownloadControlRunnables.poll()) != null) { nextToCloseRunnable.shutdown(); } Thread nextToCloseThread = null; List<Thread> toJoinThreads = new ArrayList<>(); while((nextToCloseThread = runningDownloadControllers.poll()) != null) { if(nextToCloseThread.isAlive()) { nextToCloseThread.interrupt(); toJoinThreads.add(nextToCloseThread); } } if(!toJoinThreads.isEmpty()) { try { Thread.sleep(5000); } catch(InterruptedException e) { Thread.currentThread().interrupt(); } } } } }
Source:
private <T> ImmutableSet<T> newFilteredImmutableSet(ImmutableSet<T> original, Predicate<T> predicate) { ImmutableSet.Builder<T> builder = ImmutableSet.builder(); for (T item : original) { if (predicate.apply(item)) builder.add(item); } return builder.build(); }

Target:
private static <T> ImmutableSet<T> newFilteredImmutableSet(ImmutableSet<T> original, Predicate<T> predicate) { ImmutableSet.Builder<T> builder = ImmutableSet.builder(); for (T item : original) { if (predicate.apply(item)) builder.add(item); } return builder.build(); }
Source:
private boolean validateFop2pdf( File fopFile, File pdffile ) throws Exception { File fopConfig = TestUtils.findTestFile( "/fop.xconf" ); OutputStream out = new BufferedOutputStream(new FileOutputStream(pdffile)); FopFactory fopFactory = FopFactory.newInstance(fopConfig); Fop fop = fopFactory.newFop("application/pdf", out); Source src = new StreamSource( fopFile ); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(); Result res = new SAXResult(fop.getDefaultHandler()); transformer.transform(src, res); return pdffile.length() > 0; }

Target:
private boolean validateFop2pdf( File fopFile, File pdffile ) throws Exception { File fopConfig = TestUtils.findTestFile( "/fop.xconf" ); OutputStream out = null; try { out = new BufferedOutputStream(new FileOutputStream(pdffile)); FopFactory fopFactory = FopFactory.newInstance(fopConfig); Fop fop = fopFactory.newFop("application/pdf", out); Source src = new StreamSource( fopFile ); TransformerFactory factory = TransformerFactory.newInstance(); Transformer transformer = factory.newTransformer(); Result res = new SAXResult(fop.getDefaultHandler()); transformer.transform(src, res); } finally { Utils.closeQuietly ( out ); } return pdffile.length() > 0; }
Source:
public Set<Square> getPossibleMoves(Point point){ Point[] adjacents = new Point[4]; adjacents[0] = new Point(point.x - 1, point.y); adjacents[1] = new Point(point.x + 1, point.y); adjacents[2] = new Point(point.x, point.y - 1); adjacents[3] = new Point(point.x, point.y + 1); Set<Square> retval = new HashSet<Square>(); for (Point p : adjacents){ if (p.x >= 0 && p.y >= 0 && p.x < size.width && p.y < size.height){ Square candidate = this.get(p); if (candidate.isPassable()) { retval.add(candidate); } } } return retval; }

Target:
public Set<Square> getPossibleMoves(Point point){ Set<Point> adjacents = new HashSet<Point>(); adjacents.add(new Point(point.x - 1, point.y)); adjacents.add(new Point(point.x + 1, point.y)); adjacents.add(new Point(point.x, point.y - 1)); adjacents.add(new Point(point.x, point.y + 1)); Set<Square> retval = new HashSet<Square>(); for (Point p : adjacents){ if (new Rectangle(0, 0, size.width, size.height).contains(p)){ Square candidate = this.get(p); if (candidate.isPassable()) { retval.add(candidate); } } } return retval; }
Source:
public void connectToSAMPHub(SedSAMPController controller) throws InterruptedException, Exception { controller.setAutoRunHub(false); controller.start(false); Thread.sleep(2000); int count = 0; while (!controller.isConnected()) { if (++count > SAMP_CONN_RETRIES) { String msg = "Failed to connect to SAMP, failing Unit tests"; logger.info(msg); fail(msg); } logger.info("waiting connection"); Thread.sleep(1000); } assertTrue(controller.isConnected()); }

Target:
public void connectToSAMPHub(SedSAMPController controller) throws InterruptedException, Exception { controller.setAutoRunHub(false); controller.start(false); int count = 0; while (!controller.isConnected()) { if (++count > SAMP_CONN_RETRIES) { String msg = "Failed to connect to SAMP, failing tests"; logger.info(msg); fail(msg); } logger.info("waiting connection"); Thread.sleep(1000); } assertTrue(controller.isConnected()); }
Source:
public void handle( HttpServletRequest request, HttpServletResponse response, AccessDeniedException exc) throws IOException, ServletException { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); if (auth != null) { logger.warn("User: " + auth.getName() + " attempted to access the protected URL: " + request.getRequestURI()); } response.sendRedirect(request.getContextPath() + "/forbidden"); }

Target:
public void handle( HttpServletRequest request, HttpServletResponse response, AccessDeniedException exc) throws IOException, ServletException { Authentication auth = SecurityContextHolder.getContext().getAuthentication(); if (auth != null) { logger.debug("User: " + auth.getName() + " attempted to access the protected URL: " + request.getRequestURI()); } response.sendRedirect(request.getContextPath() + "/forbidden"); }
Source:
public void setFilters(@NonNull ViewerFilter[] filters) { fFilters.clear(); if (filters != null) { List<@NonNull ViewerFilter> filtersList = Arrays.asList(filters); fFilters.addAll(filtersList); fireFiltersAdded(filtersList); } }

Target:
public void setFilters(@NonNull ViewerFilter[] filters) { fFilters.clear(); if (filters != null) { List<@NonNull ViewerFilter> filtersList = Arrays.asList(filters); fFilters.addAll(filtersList); fireFiltersChanged(filtersList); } }
Source:
private int parseFieldName(char current, int pos) { if (current == '{') { state = ParseState.INIT; } else { state = ParseState.FIELD; nesting++; if (matcher.region(pos, value.length()).find()) { currentFieldName = matcher.group("name"); pos = matcher.end() - 1; } } return pos; }

Target:
private int parseFieldName(char current, int pos) { if (current == '{') { state = ParseState.INIT; } else { state = ParseState.FIELD; nesting++; if (fieldContentMatcher.region(pos, value.length()).find()) { currentFieldName = fieldContentMatcher.group("name"); pos = fieldContentMatcher.end() - 1; } } return pos; }
Source:
private static List<String> linesFromData(final byte[] data) throws IOException { final List<String> lines = new ArrayList<String>(); final BufferedReader reader = new BufferedReader(new InputStreamReader(new ByteArrayInputStream(data), CHARSET)); try { while (true) { final String currentLine = reader.readLine(); if (currentLine == null) { break; } lines.add(currentLine); } } finally { reader.close(); } return lines; }

Target:
private static List<String> linesFromData(final byte[] data) throws IOException { final List<String> lines = new ArrayList<String>(); try (BufferedReader reader = new BufferedReader( new InputStreamReader(new ByteArrayInputStream(data), CHARSET))) { while (true) { final String currentLine = reader.readLine(); if (currentLine == null) { break; } lines.add(currentLine); } } return lines; }
Source:
public RajawaliPipRenderer(Context context, float pipScale, float pipMarginX, float pipMarginY) { super(context); this.pipScale = pipScale; this.pipMarginX = pipMarginX; this.pipMarginY = pipMarginY; }

Target:
public RajawaliPipRenderer(Context context, float pipScale, float pipMarginX, float pipMarginY) { super(context); mPipScale = pipScale; mPipMarginX = pipMarginX; mPipMarginY = pipMarginY; }
Source:
public void handleServerSide(EntityPlayerMP playerEntity) { System.out.println("Received PacketBulletTrail on Server. This packet should only be send to clients"); }

Target:
public void handleServerSide(EntityPlayerMP playerEntity) { FlansMod.log.warn("Received PacketBulletTrail on Server. This packet should only be send to clients"); }
Source:
private static Connection getClosedConnection() { InvocationHandler handler = new InvocationHandler() { @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { final String methodName = method.getName(); if ("isValid".equals(methodName)) { return Boolean.FALSE; } else if ("close".equals(methodName)) { return Void.TYPE; } else if ("abort".equals(methodName)) { return Void.TYPE; } else if ("toString".equals(methodName)) { return ClosedConnection.class.getCanonicalName(); } throw new SQLException("Connection is closed"); } }; return (Connection) Proxy.newProxyInstance(Connection.class.getClassLoader(), new Class[] { Connection.class }, handler); }

Target:
private static Connection getClosedConnection() { InvocationHandler handler = new InvocationHandler() { @Override public Object invoke(Object proxy, Method method, Object[] args) throws Throwable { final String methodName = method.getName(); if ("abort".equals(methodName)) { return Void.TYPE; } else if ("isValid".equals(methodName)) { return Boolean.FALSE; } else if ("toString".equals(methodName)) { return ClosedConnection.class.getCanonicalName(); } throw new SQLException("Connection is closed"); } }; return (Connection) Proxy.newProxyInstance(Connection.class.getClassLoader(), new Class[] { Connection.class }, handler); }
Source:
public boolean isTaskExecutable(NodeSet selectedNodes, EligibleTaskDescriptor task) { String requiredLicenses = getRequiredLicenses(task); if (requiredLicenses != null) { logger.debug("Try to get tokens for licenses " + requiredLicenses); final HashSet<String> requiredLicensesSet = new HashSet<String>(Arrays.asList(requiredLicenses.split(","))); for (String requiredLicense : requiredLicensesSet) { if (!licenseSynchronization.containsJobId(requiredLicense, ((EligibleTaskDescriptorImpl) task).getInternal() .getJobId() .value()) && !canGetToken(requiredLicense)) { logger.debug("Token for " + requiredLicense + " not available, keep task pending"); return false; } } logger.debug("Task can be executed since all tokens are available for licenses " + requiredLicenses); for (String requiredLicense : requiredLicensesSet) { if (!licenseSynchronization.containsJobId(requiredLicense, ((EligibleTaskDescriptorImpl) task).getInternal() .getJobId() .value())) { licenseSynchronization.addTaskToLicense(requiredLicense, task.getTaskId().toString()); licenseSynchronization.acquireToken(requiredLicense); licenseSynchronization.getAndPutForTasksLicensePersist(requiredLicense); } else { logger.debug("The license " + requiredLicense + " is already obtained at the job level, use it without getting a new token"); } } licenseSynchronization.persist(); return true; } else { logger.debug("Executable since it does not require any license"); return true; } }

Target:
public boolean isTaskExecutable(NodeSet selectedNodes, EligibleTaskDescriptor task) { String requiredLicenses = getRequiredLicenses(task); if (requiredLicenses != null) { logger.debug("Try to get tokens for licenses " + requiredLicenses); final HashSet<String> requiredLicensesSet = new HashSet<String>(Arrays.asList(requiredLicenses.split(","))); for (String requiredLicense : requiredLicensesSet) { if (!licenseSynchronization.containsJobId(requiredLicense, ((EligibleTaskDescriptorImpl) task).getInternal() .getJobId() .value()) && !canGetToken(requiredLicense)) { logger.debug("Token for " + requiredLicense + " not available, keep task pending"); return false; } } logger.debug("Task can be executed since all tokens are available for licenses " + requiredLicenses); for (String requiredLicense : requiredLicensesSet) { if (!licenseSynchronization.containsJobId(requiredLicense, ((EligibleTaskDescriptorImpl) task).getInternal() .getJobId() .value())) { licenseSynchronization.addTaskToLicense(requiredLicense, task.getTaskId().toString()); licenseSynchronization.markTaskLicenseChange(requiredLicense); } else { logger.debug("The license " + requiredLicense + " is already obtained at the job level, use it without getting a new token"); } } licenseSynchronization.persist(); return true; } else { logger.debug("Executable since it does not require any license"); return true; } }
Source:
private static Stream<String> getNamespacesFromUseCaseResolvedDirectory(Path logDirectory) { File[] directories = logDirectory.toFile().listFiles(File::isDirectory); if (directories == null) { LoggerFactory.getLogger(DiskNamespaceLoader.class) .error("Could not get file for the directory {}", SafeArg.of("dirName", logDirectory)); return Stream.of(); } return Arrays.stream(directories).map(File::getName); }

Target:
private static Stream<String> getNamespacesFromUseCaseResolvedDirectory(Path logDirectory) { if (Files.notExists(logDirectory)) { log.info("No namespace directory exists at path: {}", SafeArg.of("dirName", logDirectory)); return Stream.of(); } File[] directories = logDirectory.toFile().listFiles(File::isDirectory); if (directories == null) { log.error("Namespace(s) cannot be read from directory: {}." + " Either the path does not denote a directory or an I/O error has occurred.", SafeArg.of("dirName", logDirectory)); throw new IllegalStateException("Failed to read directory: " + logDirectory + ". Either the path is invalid or an I/O error has occurred."); } return Arrays.stream(directories).map(File::getName); }
Source:
protected void processUnknownExtensionElement( ExtensibilityElement element, Node parentNode ) throws Exception { logger.debug("Unknown extension element {}", element); }

Target:
protected void processUnknownExtensionElement( ExtensibilityElement element, Node parentNode ) throws Exception { logger.debug("Unknown extension element: {0}", element); }
Source:
public ImageName(String fullName, String givenTag) { if (fullName == null) { throw new NullPointerException("Image name must not be null"); } if(fullName.contains("@sha256")) { String[] digestParts = fullName.split("@"); digest = digestParts[1]; repository = digestParts[0]; } else { digest = null; Pattern tagPattern = Pattern.compile("^(.+?)(?::([^:/]+))?$"); Matcher matcher = tagPattern.matcher(fullName); if (!matcher.matches()) { throw new IllegalArgumentException(fullName + " is not a proper image name ([registry/][repo][:port]"); } tag = givenTag != null ? givenTag : matcher.group(2); String rest = matcher.group(1); String[] parts = rest.split("\\s*/\\s*"); if (parts.length == 1) { registry = null; user = null; repository = parts[0]; } else if (parts.length >= 2) { if (isRegistry(parts[0])) { registry = parts[0]; if (parts.length > 2) { user = parts[1]; repository = joinTail(parts); } else { user = null; repository = parts[1]; } } else { registry = null; user = parts[0]; repository = rest; } } if (tag == null) { tag = "latest"; } } doValidate(); }

Target:
public ImageName(String fullName, String givenTag) { if (fullName == null) { throw new NullPointerException("Image name must not be null"); } if(fullName.contains("@sha256")) { String[] digestParts = fullName.split("@"); digest = digestParts[1]; parseComponentsBeforeTag(digestParts[0]); } else { digest = null; Pattern tagPattern = Pattern.compile("^(.+?)(?::([^:/]+))?$"); Matcher matcher = tagPattern.matcher(fullName); if (!matcher.matches()) { throw new IllegalArgumentException(fullName + " is not a proper image name ([registry/][repo][:port]"); } tag = givenTag != null ? givenTag : matcher.group(2); String rest = matcher.group(1); parseComponentsBeforeTag(rest); if (tag == null) { tag = "latest"; } } doValidate(); }
Source:
public List<Part> specify(long offset, long length) { Builder<Part> parts = ImmutableList.builder(); parts.add(new Part(1, length, offset, null, null)); return parts.build(); }

Target:
public List<Part> specify(long offset, long length) { return ImmutableList.of(new Part(1, length, offset, null, null)); }
Source:
public void testCreate() throws Exception { MockWebServer server = mockOpenStackServer(); server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json")))); server.enqueue(addCommonHeaders(new MockResponse() .setResponseCode(201) .addHeader("ETag", "d9f5eb4bba4e2f2f046e54611bc8196b")) .addHeader("Expires", "d9f5eb4bba4e2f2f046e54611bc8196b")); try { SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift"); assertEquals( api.getObjectApiForRegionAndContainer("DFW", "myContainer").put("myObject", PAYLOAD, metadata(metadata)), "d9f5eb4bba4e2f2f046e54611bc8196b"); assertEquals(server.getRequestCount(), 2); assertAuthentication(server); RecordedRequest replace = server.takeRequest(); assertRequest(replace, "PUT", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/myContainer/myObject"); assertEquals(new String(replace.getBody()), "swifty"); for (Entry<String, String> entry : metadata.entrySet()) { assertEquals(replace.getHeader(OBJECT_METADATA_PREFIX + entry.getKey().toLowerCase()), entry.getValue()); } } finally { server.shutdown(); } }

Target:
public void testCreate() throws Exception { MockWebServer server = mockOpenStackServer(); server.enqueue(addCommonHeaders(new MockResponse().setBody(stringFromResource("/access.json")))); server.enqueue(addCommonHeaders(new MockResponse() .setResponseCode(201) .addHeader("ETag", "d9f5eb4bba4e2f2f046e54611bc8196b")) .addHeader("Expires", "1406243553")); try { SwiftApi api = api(server.getUrl("/").toString(), "openstack-swift"); assertEquals( api.getObjectApiForRegionAndContainer("DFW", "myContainer").put("myObject", PAYLOAD, metadata(metadata)), "d9f5eb4bba4e2f2f046e54611bc8196b"); assertEquals(server.getRequestCount(), 2); assertAuthentication(server); RecordedRequest replace = server.takeRequest(); assertRequest(replace, "PUT", "/v1/MossoCloudFS_5bcf396e-39dd-45ff-93a1-712b9aba90a9/myContainer/myObject"); assertEquals(new String(replace.getBody()), "swifty"); for (Entry<String, String> entry : metadata.entrySet()) { assertEquals(replace.getHeader(OBJECT_METADATA_PREFIX + entry.getKey().toLowerCase()), entry.getValue()); } } finally { server.shutdown(); } }
Source:
public CompletableFuture<FileWrapper> uploadFileSection(String filename, AsyncReader fileData, boolean isHidden, long startIndex, long endIndex, Optional<SymmetricKey> baseKey, boolean overwriteExisting, NetworkAccess network, Crypto crypto, ProgressConsumer<Long> monitor, byte[] firstChunkMapKey) { if (isWritable()) return network.synchronizer.applyComplexUpdate(owner(), signingPair(), (current, committer) -> uploadFileSection(current, committer, filename, fileData, isHidden, startIndex, endIndex, baseKey, overwriteExisting, true, network, crypto, monitor, firstChunkMapKey)) .thenCompose(finalBase -> getUpdated(finalBase, network)); if (! overwriteExisting) return Futures.errored(new IllegalStateException("Cannot upload a file to a directory without write access!")); return getChild(filename, crypto.hasher, network) .thenCompose(c -> { if (! c.isPresent()) return Futures.errored(new IllegalStateException("No child with name " + filename)); FileWrapper child = c.get(); return network.synchronizer.applyComplexUpdate(owner(), child.signingPair(), (current, committer) -> updateExistingChild(current, committer, child, fileData, startIndex, endIndex, network, crypto, monitor)) .thenApply(this::withVersion); }); }

Target:
public CompletableFuture<FileWrapper> uploadFileSection(String filename, AsyncReader fileData, boolean isHidden, long startIndex, long endIndex, Optional<SymmetricKey> baseKey, boolean overwriteExisting, NetworkAccess network, Crypto crypto, ProgressConsumer<Long> monitor, byte[] firstChunkMapKey) { if (isWritable()) return network.synchronizer.applyComplexUpdate(owner(), signingPair(), (current, committer) -> uploadFileSection(current, committer, filename, fileData, isHidden, startIndex, endIndex, baseKey, overwriteExisting, false, network, crypto, monitor, firstChunkMapKey)) .thenCompose(finalBase -> getUpdated(finalBase, network)); if (! overwriteExisting) return Futures.errored(new IllegalStateException("Cannot upload a file to a directory without write access!")); return getChild(filename, crypto.hasher, network) .thenCompose(c -> { if (! c.isPresent()) return Futures.errored(new IllegalStateException("No child with name " + filename)); FileWrapper child = c.get(); return network.synchronizer.applyComplexUpdate(owner(), child.signingPair(), (current, committer) -> updateExistingChild(current, committer, child, fileData, startIndex, endIndex, network, crypto, monitor)) .thenApply(this::withVersion); }); }
Source:
public Observable<Void> handle(final ObservableConnection<I, O> connection) { ChannelHandlerContext ctx = connection.getChannelHandlerContext(); final ChannelPipeline p = ctx.channel().pipeline(); ChannelHandlerContext hctx = p.context(WebSocketServerHandler.class); if (hctx != null) { WebSocketServerHandler handler = p.get(WebSocketServerHandler.class); final PublishSubject<Void> subject = PublishSubject.create(); handler.handshakeFuture().addListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { originalHandler.handle(connection).subscribe(subject); } }); return subject; } return originalHandler.handle(connection); }

Target:
public Observable<Void> handle(final ObservableConnection<I, O> connection) { ChannelHandlerContext ctx = connection.getChannelHandlerContext(); final ChannelPipeline p = ctx.channel().pipeline(); ChannelHandlerContext hctx = p.context(WebSocketServerHandler.class); if (hctx != null) { WebSocketServerHandler handler = p.get(WebSocketServerHandler.class); final PublishSubject<Void> subject = PublishSubject.create(); handler.addHandshakeFinishedListener(new ChannelFutureListener() { @Override public void operationComplete(ChannelFuture future) throws Exception { originalHandler.handle(connection).subscribe(subject); } }); return subject; } return originalHandler.handle(connection); }
Source:
private FBNetworkElement findMappingTargetFromName(String targetName) { FBNetworkElement element = null; if (null != targetName) { ArrayDeque<String> parts = new ArrayDeque<>(Arrays.asList(targetName.split("\\."))); if (parts.size() >= 2) { FBNetwork nw = null; Device dev = system.getDeviceNamed(parts.getFirst()); Application application = system.getApplicationNamed(parts.getFirst()); if (null != dev) { parts.pollFirst(); Resource res = dev.getResourceNamed(parts.pollFirst()); if (null != res) { nw = res.getFBNetwork(); element = findMappingTargetInFBNetwork(nw, parts); } } if (null == element && null != application) { parts = new ArrayDeque<>(Arrays.asList(targetName.split("\\."))); parts.pollFirst(); nw = application.getFBNetwork(); element = findMappingTargetInFBNetwork(nw, parts); } } } return element; }

Target:
private FBNetworkElement findMappingTargetFromName(String targetName) { FBNetworkElement element = null; if (null != targetName) { Deque<String> parts = new ArrayDeque<>(Arrays.asList(targetName.split("\\."))); if (parts.size() >= 2) { FBNetwork nw = null; Device dev = system.getDeviceNamed(parts.getFirst()); Application application = system.getApplicationNamed(parts.getFirst()); if (null != dev) { parts.pollFirst(); Resource res = dev.getResourceNamed(parts.pollFirst()); if (null != res) { nw = res.getFBNetwork(); element = findMappingTargetInFBNetwork(nw, parts); } } if (null == element && null != application) { parts = new ArrayDeque<>(Arrays.asList(targetName.split("\\."))); parts.pollFirst(); nw = application.getFBNetwork(); element = findMappingTargetInFBNetwork(nw, parts); } } } return element; }
Source:
public void setup() { for (int ii = 0; ii < BUF_LEN; ++ii) bb[ii] = (byte)ii; }

Target:
public void setup() { new Random().ints(BUF_LEN, Byte.MIN_VALUE, Byte.MAX_VALUE).forEach(k -> bb.put((byte) k)); }
Source:
protected void createCacheManagers() throws Throwable { super.createCacheManagers(); for (EmbeddedCacheManager cacheManager : cacheManagers) { multimapCacheCluster.put(cacheManager.getAddress().toString(), EmbeddedMultimapCacheManagerFactory.get(cacheName, cacheManager, configuration.build())); } }

Target:
protected void createCacheManagers() throws Throwable { super.createCacheManagers(); for (EmbeddedCacheManager cacheManager : cacheManagers) { MultimapCacheManager multimapCacheManager = EmbeddedMultimapCacheManagerFactory.from(cacheManager); multimapCacheCluster.put(cacheManager.getAddress(), multimapCacheManager.get(cacheName)); } }
Source:
public void enter() { super.enter(); mPhonebook.resetAtState(); mSystemInterface.getHeadsetPhoneState().listenForPhoneState(false); mVoiceRecognitionStarted = false; mWaitingForVoiceRecognition = false; mAudioParams.clear(); processWBSEvent(0); if (mPrevState == mConnecting) { broadcastConnectionState(mCurrentDevice, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.STATE_CONNECTING); } else if (mPrevState == mDisconnecting) { broadcastConnectionState(mCurrentDevice, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.STATE_DISCONNECTING); } else if (mPrevState instanceof ConnectedBase) { if (mPrevState == mAudioConnecting) { broadcastAudioState(mCurrentDevice, BluetoothHeadset.STATE_AUDIO_DISCONNECTED, BluetoothHeadset.STATE_AUDIO_CONNECTING); } else if (mPrevState == mAudioOn || mPrevState == mAudioDisconnecting) { broadcastAudioState(mCurrentDevice, BluetoothHeadset.STATE_AUDIO_DISCONNECTED, BluetoothHeadset.STATE_AUDIO_CONNECTED); } broadcastConnectionState(mCurrentDevice, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.STATE_CONNECTED); } else if (mPrevState != null) { stateLogWtfStack("Illegal state transition from " + mPrevState + ", mCurrentDevice=" + mCurrentDevice); } mCurrentDevice = null; }

Target:
public void enter() { super.enter(); mPhonebook.resetAtState(); mSystemInterface.getHeadsetPhoneState().listenForPhoneState(false); mVoiceRecognitionStarted = false; mWaitingForVoiceRecognition = false; mAudioParams.clear(); processWBSEvent(HeadsetHalConstants.BTHF_WBS_NO); if (mPrevState == mConnecting) { broadcastConnectionState(mCurrentDevice, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.STATE_CONNECTING); } else if (mPrevState == mDisconnecting) { broadcastConnectionState(mCurrentDevice, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.STATE_DISCONNECTING); } else if (mPrevState instanceof ConnectedBase) { if (mPrevState == mAudioConnecting) { broadcastAudioState(mCurrentDevice, BluetoothHeadset.STATE_AUDIO_DISCONNECTED, BluetoothHeadset.STATE_AUDIO_CONNECTING); } else if (mPrevState == mAudioOn || mPrevState == mAudioDisconnecting) { broadcastAudioState(mCurrentDevice, BluetoothHeadset.STATE_AUDIO_DISCONNECTED, BluetoothHeadset.STATE_AUDIO_CONNECTED); } broadcastConnectionState(mCurrentDevice, BluetoothProfile.STATE_DISCONNECTED, BluetoothProfile.STATE_CONNECTED); } else if (mPrevState != null) { stateLogWtfStack("Illegal state transition from " + mPrevState + ", mCurrentDevice=" + mCurrentDevice); } mCurrentDevice = null; }
Source:
public Mono<OffsetDateTime> renewMessageLock(ServiceBusReceivedMessage message) { if (isDisposed.get()) { return monoError(logger, new IllegalStateException( String.format(INVALID_OPERATION_DISPOSED_RECEIVER, "renewMessageLock"))); } else if (Objects.isNull(message)) { return monoError(logger, new NullPointerException("'message' cannot be null.")); } else if (message.getLockToken().isEmpty()) { throw logger.logExceptionAsError(new IllegalArgumentException("'message.getLockToken()' cannot be empty.")); } else if (receiverOptions.isSessionReceiver()) { return monoError(logger, new IllegalStateException( String.format("Cannot renew message lock [%s] for a session receiver.", message.getLockToken()))); } return connectionProcessor .flatMap(connection -> connection.getManagementNode(entityPath, entityType)) .flatMap(serviceBusManagementNode -> serviceBusManagementNode.renewMessageLock(message.getLockToken(), getLinkName(null))) .map(instant -> managementNodeLocks.addOrUpdate(message.getLockToken(), instant, instant.atOffset(ZoneOffset.UTC)).atOffset(ZoneOffset.UTC)); }

Target:
public Mono<OffsetDateTime> renewMessageLock(ServiceBusReceivedMessage message) { if (isDisposed.get()) { return monoError(logger, new IllegalStateException( String.format(INVALID_OPERATION_DISPOSED_RECEIVER, "renewMessageLock"))); } else if (Objects.isNull(message)) { return monoError(logger, new NullPointerException("'message' cannot be null.")); } else if (Objects.isNull(message.getLockToken())) { return monoError(logger, new NullPointerException("'message.getLockToken()' cannot be null.")); } else if (message.getLockToken().isEmpty()) { return monoError(logger, new IllegalArgumentException("'message.getLockToken()' cannot be empty.")); } else if (receiverOptions.isSessionReceiver()) { return monoError(logger, new IllegalStateException( String.format("Cannot renew message lock [%s] for a session receiver.", message.getLockToken()))); } return connectionProcessor .flatMap(connection -> connection.getManagementNode(entityPath, entityType)) .flatMap(serviceBusManagementNode -> serviceBusManagementNode.renewMessageLock(message.getLockToken(), getLinkName(null))) .map(instant -> managementNodeLocks.addOrUpdate(message.getLockToken(), instant, instant.atOffset(ZoneOffset.UTC)).atOffset(ZoneOffset.UTC)); }
Source:
private CfDef createDefaultCfDef(String namespace, String tableName) { return new CfDef() .setKeyspace(namespace) .setName(tableName) .setComment("") .setColumn_metadata(new ArrayList<>()) .setTriggers(new LinkedList<>()) .setKey_alias(new byte[] {0x6B, 0x65, 0x79}) .setComparator_type("org.apache.cassandra.db.marshal.CompositeType" + "(org.apache.cassandra.db.marshal.BytesType,org.apache.cassandra.db.marshal.LongType)") .setCompaction_strategy_options(new HashMap<>()) .setRead_repair_chance(0.0) .setGc_grace_seconds(345600) .setDefault_validation_class("org.apache.cassandra.db.marshal.BytesType") .setMin_compaction_threshold(4) .setMax_compaction_threshold(32) .setKey_validation_class("org.apache.cassandra.db.marshal.BytesType") .setCompaction_strategy("org.apache.cassandra.db.compaction.LeveledCompactionStrategy") .setCompression_options( ImmutableMap.<String, String>builder() .put("sstable_compression", "org.apache.cassandra.io.compress.LZ4Compressor") .put("chunk_length_kb", "4") .build()) .setBloom_filter_fp_chance(0.1) .setCaching("KEYS_ONLY") .setDclocal_read_repair_chance(0.1) .setMemtable_flush_period_in_ms(0) .setDefault_time_to_live(0) .setSpeculative_retry("NONE") .setCells_per_row_to_cache("0") .setMin_index_interval(128) .setMax_index_interval(2048); }

Target:
private CfDef createDefaultCfDef(String namespace, String tableName) { return new CfDef() .setKeyspace(namespace) .setName(tableName) .setComment("") .setColumn_metadata(new ArrayList<>()) .setTriggers(new LinkedList<>()) .setKey_alias(new byte[] {0x6B, 0x65, 0x79}) .setComparator_type("org.apache.cassandra.db.marshal.CompositeType" + "(org.apache.cassandra.db.marshal.BytesType,org.apache.cassandra.db.marshal.LongType)") .setCompaction_strategy_options(new HashMap<>()) .setRead_repair_chance(0.0) .setGc_grace_seconds(FOUR_DAYS_IN_SECONDS) .setDefault_validation_class("org.apache.cassandra.db.marshal.BytesType") .setMin_compaction_threshold(4) .setMax_compaction_threshold(32) .setKey_validation_class("org.apache.cassandra.db.marshal.BytesType") .setCompaction_strategy("org.apache.cassandra.db.compaction.LeveledCompactionStrategy") .setCompression_options( ImmutableMap.<String, String>builder() .put("sstable_compression", "org.apache.cassandra.io.compress.LZ4Compressor") .put("chunk_length_kb", "4") .build()) .setBloom_filter_fp_chance(0.1) .setCaching("KEYS_ONLY") .setDclocal_read_repair_chance(0.1) .setMemtable_flush_period_in_ms(0) .setDefault_time_to_live(0) .setSpeculative_retry("NONE") .setCells_per_row_to_cache("0") .setMin_index_interval(128) .setMax_index_interval(2048); }
Source:
private Filter adaptBinaryComparator( FilterAdapterContext context, CompareOp compareOp, BinaryComparator comparator) throws IOException { ByteString quotedValue = ByteString.copyFrom(comparator.getValue()); switch (compareOp) { case LESS: return FILTERS .qualifier() .rangeWithinFamily(FilterAdapterHelper.getSingleFamilyName(context)) .endOpen(quotedValue); case LESS_OR_EQUAL: return FILTERS .qualifier() .rangeWithinFamily(FilterAdapterHelper.getSingleFamilyName(context)) .endClosed(quotedValue); case EQUAL: return FILTERS .qualifier() .regex(ReaderExpressionHelper.quoteRegularExpression(comparator.getValue())); case NOT_EQUAL: String familyName = FilterAdapterHelper.getSingleFamilyName(context); return FILTERS .interleave() .filter(FILTERS.qualifier().rangeWithinFamily(familyName).endOpen(quotedValue)) .filter(FILTERS.qualifier().rangeWithinFamily(familyName).startOpen(quotedValue)); case GREATER_OR_EQUAL: return FILTERS .qualifier() .rangeWithinFamily(FilterAdapterHelper.getSingleFamilyName(context)) .startClosed(quotedValue); case GREATER: return FILTERS .qualifier() .rangeWithinFamily(FilterAdapterHelper.getSingleFamilyName(context)) .startOpen(quotedValue); case NO_OP: return FILTERS.pass(); default: throw new IllegalStateException( String.format("Cannot handle unknown compare op %s", compareOp)); } }

Target:
private Filter adaptBinaryComparator( FilterAdapterContext context, CompareOp compareOp, BinaryComparator comparator) throws IOException { ByteString value = ByteString.copyFrom(comparator.getValue()); switch (compareOp) { case LESS: return FILTERS .qualifier() .rangeWithinFamily(FilterAdapterHelper.getSingleFamilyName(context)) .endOpen(value); case LESS_OR_EQUAL: return FILTERS .qualifier() .rangeWithinFamily(FilterAdapterHelper.getSingleFamilyName(context)) .endClosed(value); case EQUAL: return FILTERS .qualifier() .regex(ReaderExpressionHelper.quoteRegularExpression(comparator.getValue())); case NOT_EQUAL: String familyName = FilterAdapterHelper.getSingleFamilyName(context); return FILTERS .interleave() .filter(FILTERS.qualifier().rangeWithinFamily(familyName).endOpen(value)) .filter(FILTERS.qualifier().rangeWithinFamily(familyName).startOpen(value)); case GREATER_OR_EQUAL: return FILTERS .qualifier() .rangeWithinFamily(FilterAdapterHelper.getSingleFamilyName(context)) .startClosed(value); case GREATER: return FILTERS .qualifier() .rangeWithinFamily(FilterAdapterHelper.getSingleFamilyName(context)) .startOpen(value); case NO_OP: return FILTERS.pass(); default: throw new IllegalStateException( String.format("Cannot handle unknown compare op %s", compareOp)); } }
Source:
public void testCreateAvroTableWithSchemaUrl() throws Exception { File tempDir = createTempDir(); File schemaFile = new File(tempDir, "avro_single_column.avsc"); Files.write("{\n" + " \"namespace\": \"com.facebook.test\",\n" + " \"name\": \"single_column\",\n" + " \"type\": \"record\",\n" + " \"fields\": [\n" + " { \"name\":\"string_col\", \"type\":\"string\" }\n" + "]}", schemaFile, UTF_8); @Language("SQL") String createTableSqlFormat = "" + "CREATE TABLE %s.%s.test_create_avro (\n" + " dummy_col varchar,\n" + " another_dummy_col varchar\n" + ")\n" + "WITH (\n" + " avro_schema_url = '%s',\n" + " format = 'AVRO'\n" + ")"; String createTableSql = format(createTableSqlFormat, getSession().getCatalog().get(), getSession().getSchema().get(), schemaFile.getAbsolutePath()); String expectedSql = format(createTableSqlFormat, getSession().getCatalog().get(), getSession().getSchema().get(), "file:/ assertUpdate(createTableSql); MaterializedResult actual = computeActual("SHOW CREATE TABLE test_create_avro"); assertEquals(actual.getOnlyValue(), expectedSql); assertUpdate("DROP TABLE test_create_avro"); deleteRecursively(tempDir.toPath(), ALLOW_INSECURE); }

Target:
public void testCreateAvroTableWithSchemaUrl() throws Exception { File tempDir = createTempDir(); File schemaFile = createSchemaFileIn(tempDir); String createTableSql = getAvroCreateTableSql(schemaFile.getAbsolutePath()); String expectedSql = getAvroCreateTableSql(schemaFile.toURI().toString()); assertUpdate(createTableSql); MaterializedResult actual = computeActual("SHOW CREATE TABLE test_create_avro"); assertEquals(actual.getOnlyValue(), expectedSql); assertUpdate("DROP TABLE test_create_avro"); deleteRecursively(tempDir.toPath(), ALLOW_INSECURE); }
Source:
private void logErrorAndWriteResponseToClient(Exception e, HttpServletResponse response) { try { String errorMessage = e.getMessage().replace("<", "&lt;").replace(">", "&gt;"); LOGGER.warn("Export node source failed", e); response.getWriter().write(errorMessage); } catch (IOException ioe) { LOGGER.warn("Failed to return node source export error to client", ioe); } }

Target:
private void logErrorAndWriteResponseToClient(Exception e, HttpServletResponse response) { try { String errorMessage = e.getMessage().replace("<", "&lt;").replace(">", "&gt;"); LOGGER.warn(EXPORT_FAILED_MESSAGE, e); response.getWriter().write(EXPORT_FAILED_MESSAGE + ": " + errorMessage); } catch (IOException ioe) { LOGGER.warn("Failed to return node source export error to client", ioe); } }
Source:
public void testIDetectNoParentEntry() throws Exception { final Path cwd = path("/" + getMethodName() + "-" + UUID.randomUUID()); final Path file = new Path(cwd, "file"); try { touch(guardedFs, file); awaitFileStatus(guardedFs, file); metadataStore.forgetMetadata(cwd); final S3GuardFsck s3GuardFsck = new S3GuardFsck(rawFS, metadataStore); final List<S3GuardFsck.ComparePair> comparePairs = s3GuardFsck.compareS3RootToMs(cwd); assertEquals("Number of pairs should be two. The cwd (parent) and the " + "child.", 2, comparePairs.size()); final S3GuardFsck.ComparePair cwdPair = comparePairs.stream() .filter(p -> p.getPath().equals(cwd)) .findFirst().get(); assertNotNull("The pair should not be null.", cwdPair); assertTrue("The cwdPair must contain a violation.", cwdPair.containsViolation()); Assertions.assertThat(cwdPair.getViolations()) .describedAs("Violations in the cwdPair") .contains(S3GuardFsck.Violation.NO_METADATA_ENTRY); final S3GuardFsck.ComparePair childPair = comparePairs.stream() .filter(p -> p.getPath().equals(file)) .findFirst().get(); assertNotNull("The pair should not be null.", childPair); assertTrue("The childPair must contain a violation.", childPair.containsViolation()); Assertions.assertThat(childPair.getViolations()) .describedAs("Violations in the childPair") .contains(S3GuardFsck.Violation.NO_PARENT_ENTRY); } finally { rawFS.delete(cwd, true); metadataStore.forgetMetadata(file); metadataStore.forgetMetadata(cwd); } }

Target:
public void testIDetectNoParentEntry() throws Exception { final Path cwd = path("/" + getMethodName() + "-" + UUID.randomUUID()); final Path file = new Path(cwd, "file"); try { touchGuardedAndWaitRaw(file); metadataStore.forgetMetadata(cwd); final S3GuardFsck s3GuardFsck = new S3GuardFsck(rawFs, metadataStore); final List<S3GuardFsck.ComparePair> comparePairs = s3GuardFsck.compareS3ToMs(cwd); assertComparePairsSize(comparePairs, 2); checkForViolationInPairs(cwd, comparePairs, S3GuardFsck.Violation.NO_METADATA_ENTRY); checkForViolationInPairs(file, comparePairs, S3GuardFsck.Violation.NO_PARENT_ENTRY); } finally { cleanup(file, cwd); } }