auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
protected Object nativeToJava(TransferData transferData) { byte[] bytes = (byte[]) super.nativeToJava(transferData); if (bytes == null) { return null; } DataInputStream in = new DataInputStream( new ByteArrayInputStream(bytes)); try { int count = in.readInt(); if (count > MAX_RESOURCES_TO_TRANSFER) { String message = "Transfer aborted, too many resources: " + count + "."; message += "\nIf you are running in x11vnc environment please consider to switch to vncserver " + "+ vncviewer or to run x11vnc without clipboard support " + "(use '-noclipboard' and '-nosetclipboard' arguments)."; IDEWorkbenchPlugin.log(message, new IllegalArgumentException( "Maximum limit of resources to transfer is: " + MAX_RESOURCES_TO_TRANSFER)); return null; } IResource[] results = new IResource[count]; for (int i = 0; i < count; i++) { results[i] = readResource(in); } return results; } catch (IOException e) { return null; } }

Target:
protected Object nativeToJava(TransferData transferData) { byte[] bytes = (byte[]) super.nativeToJava(transferData); if (bytes == null) { return null; } DataInputStream in = new DataInputStream( new ByteArrayInputStream(bytes)); try { int count = in.readInt(); if (count > MAX_RESOURCES_TO_TRANSFER) { String message = "Transfer aborted, too many resources: " + count + "."; if (Util.isLinux()) { message += "\nIf you are running in x11vnc environment please consider to switch to vncserver " + "+ vncviewer or to run x11vnc without clipboard support " + "(use '-noclipboard' and '-nosetclipboard' arguments)."; } IDEWorkbenchPlugin.log(message, new IllegalArgumentException( "Maximum limit of resources to transfer is: " + MAX_RESOURCES_TO_TRANSFER)); return null; } IResource[] results = new IResource[count]; for (int i = 0; i < count; i++) { results[i] = readResource(in); } return results; } catch (IOException e) { return null; } }
Source:
private String getFunctionFromOriginalLocation(String origLocation) { if (origLocation.isEmpty()) { GdbPlugin.log(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, "Invalid 'original-location' attribute")); return ""; } if (origLocation.startsWith("*")) return ""; int index = origLocation.lastIndexOf(':'); String function = (index >= 0) ? origLocation.substring(index + 1, origLocation.length()) : origLocation; try { Integer.valueOf(function); return ""; } catch(NumberFormatException e) { } return function; }

Target:
private String getFunctionFromOriginalLocation(String origLocation) { if (origLocation.isEmpty()) { GdbPlugin.log(new Status(IStatus.ERROR, GdbPlugin.PLUGIN_ID, "Invalid 'original-location' attribute")); return ""; } if (origLocation.startsWith("*")) return ""; int index = origLocation.lastIndexOf(':'); String function = (index >= 0) ? origLocation.substring(index + 1) : origLocation; try { Integer.valueOf(function); return ""; } catch(NumberFormatException e) { } return function; }
Source:
private void updateBoundMember(final Object instance, final AccessibleObject element, final ConfigBinding binding) { if (!element.isAccessible()) { element.setAccessible(true); } final Object value = getValue(binding, getTargetClass(element)); if (element instanceof Field) { try { ((Field) element).set(instance, value); } catch (IllegalAccessException | IllegalArgumentException ex) { } } if (element instanceof Method) { try { ((Method) element).invoke(instance, value); } catch (IllegalAccessException | IllegalArgumentException ex) { } catch (InvocationTargetException ex) { eventBus.publish(new UserErrorEvent(ErrorLevel.HIGH, ex, "Exception when updating bound setting", "")); } } }

Target:
private void updateBoundMember(final Object instance, final AccessibleObject element, final ConfigBinding binding) { if (!element.isAccessible()) { element.setAccessible(true); } final Object value = getValue(binding, getTargetClass(element)); if (element instanceof Field) { try { ((Field) element).set(instance, value); } catch (IllegalAccessException | IllegalArgumentException ex) { } } if (element instanceof Method) { try { ((Method) element).invoke(instance, value); } catch (IllegalAccessException | IllegalArgumentException ex) { } catch (InvocationTargetException ex) { eventBus.publish(new AppErrorEvent(ErrorLevel.HIGH, ex, "Exception when updating bound setting", "")); } } }
Source:
public WrappedHttpClient( ClientSecurityConfig config, HttpClientTransport transport, SslContextFactory sslContextFactory) { super(transport, sslContextFactory); authenticationStore = new ExpiringAuthenticationStore(new SpnegoAuthentication( config.getKrb5ConfPath(), config.getServiceName())); }

Target:
public WrappedHttpClient(ClientSecurityConfig config, HttpClientTransport transport, SslContextFactory sslContextFactory) { super(transport, sslContextFactory); authenticationStore = new ExpiringAuthenticationStore(new SpnegoAuthentication( config.getKrb5Keytab(), config.getKrb5Config(), config.getKrb5CredentialCache(), config.getKrb5Principal(), config.getKrb5RemoteServiceName())); }
Source:
public void addTraverseListener(TraverseListener listener) { if (this.text != null && !this.text.isDisposed()) this.text.addTraverseListener(listener); if (this.dropdownTableViewer != null && !this.dropdownTable.isDisposed()) this.dropdownTable.addTraverseListener(listener); }

Target:
public void addTraverseListener(TraverseListener listener) { if (this.text != null && !this.text.isDisposed()) this.text.addTraverseListener(listener); if (this.dropdownTable != null && !this.dropdownTable.isDisposed()) this.dropdownTable.addTraverseListener(listener); }
Source:
void activateMode(ApplicationMode mode) { if (!ApplicationMode.values(app).contains(mode)) { StringBuilder s = new StringBuilder(ApplicationMode.DEFAULT.getStringKey() + ","); for (ApplicationMode am : ApplicationMode.values(app)) { s.append(am.getStringKey()).append(","); } s.append(mode.getStringKey()).append(","); if (getSettings() != null) { getSettings().AVAILABLE_APP_MODES.set(s.toString()); } } }

Target:
void activateMode(ApplicationMode mode) { if (!ApplicationMode.values(app).contains(mode)) { ApplicationMode.changeProfileStatus(mode, true, getMyApplication()); } }
Source:
public TransformWork(Work<I> work, Function<I, O> transformation) { this.work = requireNonNull(work, "prerequisite is null"); this.transformation = requireNonNull(transformation, "transformation is null"); }

Target:
public TransformWork(Work<I> work, Function<I, O> transformation) { this.work = requireNonNull(work, "work is null"); this.transformation = requireNonNull(transformation, "transformation is null"); }
Source:
public UriAuthority(String authority) { MatchResult matcher = AUTHORITY_REGEXP.exec(authority == null ? EMPTY_STRING : authority); if (matcher == null) { this.host = null; this.port = null; valid = false; } else { String group1 = matcher.getGroup(1); this.host = (group1 == null) ? EMPTY_STRING : group1; String group2 = matcher.getGroup(2); this.port = (group2 == null) ? EMPTY_STRING : group2; valid = validatePort(); } }

Target:
public UriAuthority(String authority) { AuthorityInfo authorityInfo = getInfo(authority); this.host = authorityInfo.host; this.port = authorityInfo.port; this.valid = authorityInfo.valid; }
Source:
public String getUnmodifiedInstance() { return m_inst.toString(); }

Target:
public String getUnmodifiedInstance() { return getInstance(); }
Source:
int getExitCode() { int size = initial.length() - 1; int value = 0; for (int i = size; i >= 0; i--) { int prefix = 0; if (initial.get(i)) { prefix = 1; } value += Math.pow(2, i) * prefix; } if (value == 1) { return 0; } return value; }

Target:
public int getExitCode() { int exitCode = 0; for (int i = 0; i < exitCodeBits.length(); i++) { if (exitCodeBits.get(i)) { exitCode = exitCode | (1 << i); } } return exitCode; }
Source:
public APIResult submitAndSchedulableExtensionJob(String extensionName, String jobName, InputStream configStream, SortedMap<EntityType, List<Entity>> entityMap) throws FalconException, IOException { List<String> feedNames = new ArrayList<>(); List<String> processNames = new ArrayList<>(); for(Map.Entry<EntityType, List<Entity>> entry : entityMap.entrySet()){ for(Entity entity : entry.getValue()){ submitInternal(entity, "falconUser"); } } for (Map.Entry<EntityType, List<Entity>> entry : entityMap.entrySet()) { for (Entity entity : entry.getValue()) { scheduleInternal(entry.getKey().name(), entity.getName(), null, null); } } byte[] configBytes = null; if (configStream != null) { configBytes = IOUtils.toByteArray(configStream); } for (Map.Entry<EntityType, List<Entity>> entry : entityMap.entrySet()) { for (final Entity entity : entry.getValue()) { if (entity.getEntityType().equals(EntityType.FEED)) { feedNames.add(entity.getName()); } else { processNames.add(entity.getName()); } } } ExtensionStore.getMetaStore().storeExtensionJob(jobName, extensionName, feedNames, processNames, configBytes); return new APIResult(APIResult.Status.SUCCEEDED, "Extension job submitted successfully" + jobName); }

Target:
APIResult submitAndSchedulableExtensionJob(String extensionName, String jobName, InputStream configStream, SortedMap<EntityType, List<Entity>> entityMap) throws FalconException, IOException { for(Map.Entry<EntityType, List<Entity>> entry : entityMap.entrySet()){ for(Entity entity : entry.getValue()){ submitInternal(entity, "falconUser"); } } storeExtension(extensionName, jobName, configStream, entityMap); for (Map.Entry<EntityType, List<Entity>> entry : entityMap.entrySet()) { for (Entity entity : entry.getValue()) { scheduleInternal(entry.getKey().name(), entity.getName(), null, null); } } return new APIResult(APIResult.Status.SUCCEEDED, "Extension job submitted and scheduled successfully" + jobName); }
Source:
private void recoverSortMenuFormPreferences(Menu menu) { if(menu != null && mDescendingMenuItem != null) { mDescendingMenuItem = menu.findItem(R.id.action_sort_descending); mDescendingMenuItem.setChecked(!PreferenceManager.getSortAscending(this)); switch (getSortOrder(this)) { case FileStorageUtils.SORT_NAME: menu.findItem(R.id.action_sort_by_name).setChecked(true); break; case FileStorageUtils.SORT_DATE: menu.findItem(R.id.action_sort_by_date).setChecked(true); break; case FileStorageUtils.SORT_SIZE: menu.findItem(R.id.action_sort_by_size).setChecked(true); default: } } }

Target:
private void recoverSortMenuFormPreferences(Menu menu) { if(menu != null) { mDescendingMenuItem.setChecked(!PreferenceManager.getSortAscending(this)); switch (getSortOrder(this)) { case FileStorageUtils.SORT_NAME: menu.findItem(R.id.action_sort_by_name).setChecked(true); break; case FileStorageUtils.SORT_DATE: menu.findItem(R.id.action_sort_by_date).setChecked(true); break; case FileStorageUtils.SORT_SIZE: menu.findItem(R.id.action_sort_by_size).setChecked(true); default: } } }
Source:
RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, IOException { for (;;) { final DepthWalk.Commit c = (DepthWalk.Commit) pending.next(); if (c == null) return null; if ((c.flags & RevWalk.PARSED) == 0) c.parseHeaders(walk); int newDepth = c.depth + 1; for (RevCommit p : c.parents) { DepthWalk.Commit dp = (DepthWalk.Commit) p; if (dp.depth == -1) { boolean failsDeepenSince = false; if (deepenSince != 0) { if ((p.flags & RevWalk.PARSED) == 0) { p.parseHeaders(walk); } failsDeepenSince = p.getCommitTime() < deepenSince; } dp.depth = newDepth; if (newDepth <= depth && !failsDeepenSince) { pending.add(p); } else { c.isBoundary = true; } } if(c.has(UNSHALLOW) || c.has(REINTERESTING)) { p.add(REINTERESTING); p.flags &= ~RevWalk.UNINTERESTING; } } boolean produce = true; if ((c.flags & RevWalk.UNINTERESTING) != 0 && !c.has(UNSHALLOW)) produce = false; if (c.getCommitTime() < deepenSince) { produce = false; } if (produce) return c; } }

Target:
RevCommit next() throws MissingObjectException, IncorrectObjectTypeException, IOException { for (;;) { final DepthWalk.Commit c = (DepthWalk.Commit) pending.next(); if (c == null) return null; if ((c.flags & RevWalk.PARSED) == 0) c.parseHeaders(walk); if (c.getCommitTime() < deepenSince) { continue; } int newDepth = c.depth + 1; for (RevCommit p : c.parents) { DepthWalk.Commit dp = (DepthWalk.Commit) p; if (dp.depth == -1) { boolean failsDeepenSince = false; if (deepenSince != 0) { if ((p.flags & RevWalk.PARSED) == 0) { p.parseHeaders(walk); } failsDeepenSince = p.getCommitTime() < deepenSince; } dp.depth = newDepth; if (newDepth <= depth && !failsDeepenSince) { pending.add(p); } else { c.isBoundary = true; } } if(c.has(UNSHALLOW) || c.has(REINTERESTING)) { p.add(REINTERESTING); p.flags &= ~RevWalk.UNINTERESTING; } } boolean produce = true; if ((c.flags & RevWalk.UNINTERESTING) != 0 && !c.has(UNSHALLOW)) produce = false; if (produce) return c; } }
Source:
private Layout updateLayoutAndGet() { return getCorfuRuntime() .invalidateLayout() .thenApply(serverContext::saveManagementLayout) .join(); }

Target:
private Layout updateLayoutAndGet() { return getCorfuRuntime() .invalidateLayout() .join(); }
Source:
private void init(FailureCollector collector) { if (!Strings.isNullOrEmpty(excelInputreaderConfig.columnList)) { String[] columnsList = excelInputreaderConfig.columnList.split(","); inputColumns = Arrays.asList(columnsList); } if (!Strings.isNullOrEmpty(excelInputreaderConfig.columnMapping)) { String[] mappings = excelInputreaderConfig.columnMapping.split(","); for (String map : mappings) { String[] columns = map.split(":"); if (CollectionUtils.isNotEmpty(inputColumns) && !inputColumns.contains(columns[0])) { collector.addFailure( String.format("Column: %s in 'Column-Label Mapping' " + "must be included in 'Column To Be Extracted'", columns[0]), null) .withConfigElement(COLUMN_MAPPING, map); } else { columnMapping.put(columns[0], columns[1]); } } } if (!Strings.isNullOrEmpty(excelInputreaderConfig.outputSchema)) { String[] schemaList = excelInputreaderConfig.outputSchema.split(","); for (String schema : schemaList) { String[] columns = schema.split(":"); if (CollectionUtils.isNotEmpty(inputColumns) && !inputColumns.contains(columns[0])) { collector.addFailure( String.format("Column: %s in 'Field Name Schema Type Mapping' " + "must be included in 'Column To Be Extracted'", columns[0]), null) .withConfigElement(OUTPUT_SCHEMA, schema); } else { outputSchemaMapping.put(columns[0], columns[1]); } } } collector.getOrThrowException(); }

Target:
private void init(FailureCollector collector) { if (!Strings.isNullOrEmpty(excelInputreaderConfig.columnList)) { String[] columnsList = excelInputreaderConfig.columnList.split(","); inputColumns = Arrays.asList(columnsList); } if (!Strings.isNullOrEmpty(excelInputreaderConfig.columnMapping)) { String[] mappings = excelInputreaderConfig.columnMapping.split(","); for (String map : mappings) { String[] columns = map.split(":"); if (columns.length < 2 || Strings.isNullOrEmpty(columns[1])) { collector.addFailure( String.format("Column: '%s' in 'Column-Label Mapping' must have an alias specified.", columns[0]), null) .withConfigElement(COLUMN_MAPPING, map); } else if (CollectionUtils.isNotEmpty(inputColumns) && !inputColumns.contains(columns[0])) { collector.addFailure( String.format("Column: '%s' in 'Column-Label Mapping' " + "must be included in 'Column To Be Extracted'", columns[0]), null) .withConfigElement(COLUMN_MAPPING, map); } else { columnMapping.put(columns[0], columns[1]); } } } if (!Strings.isNullOrEmpty(excelInputreaderConfig.outputSchema)) { String[] schemaList = excelInputreaderConfig.outputSchema.split(","); for (String schema : schemaList) { String[] columns = schema.split(":"); if (columns.length < 2 || Strings.isNullOrEmpty(columns[1])) { collector.addFailure( String.format("Column: '%s' in 'Field Name Schema Type Mapping' must have an type.", columns[0]), null) .withConfigElement(OUTPUT_SCHEMA, schema); } else if (CollectionUtils.isNotEmpty(inputColumns) && !inputColumns.contains(columns[0])) { collector.addFailure( String.format("Column: '%s' in 'Field Name Schema Type Mapping' " + "must be included in 'Column To Be Extracted'", columns[0]), null) .withConfigElement(OUTPUT_SCHEMA, schema); } else { outputSchemaMapping.put(columns[0], columns[1]); } } } }
Source:
public void handleAction(final ActionParameters params) throws ActionException { final JSONArray data = new JSONArray(); OskariLayerService mapLayerService = new OskariLayerServiceIbatisImpl(); OskariLayer oskariLayer = mapLayerService.find(params.getHttpParam(PARAM_URL)); if(oskariLayer != null){ FINAL_WMS_URL = oskariLayer.getUrl(); } String wmsUrl = Helpers.getGetFeatureInfoUrlForProxy(FINAL_WMS_URL, params.getHttpParam(PARAM_SRS).toString(), params.getHttpParam(PARAM_BBOX).toString(), params.getHttpParam(PARAM_WIDTH).toString(), params.getHttpParam(PARAM_HEIGHT).toString(), params.getHttpParam(PARAM_X).toString(), params.getHttpParam(PARAM_Y).toString(), params.getHttpParam(PARAM_LAYERS).toString()); System.out.println(wmsUrl); URL wms; try { wms = new URL(wmsUrl); URLConnection wmsConn = wms.openConnection(); wmsConn.setRequestProperty("Accept-Charset", "UTF-8"); BufferedReader in = new BufferedReader( new InputStreamReader( wmsConn.getInputStream(), "UTF-8" ) ); String inputLine; String html = ""; while ((inputLine = in.readLine()) != null) { html += inputLine; } in.close(); JSONObject jsoni = new JSONObject(html); ResponseHelper.writeResponse(params, jsoni); } catch (JSONException e) { throw new ActionException("Could not populate Response JSON: " + LOGGER.getAsString(data), e); } catch (MalformedURLException e) { throw new ActionException("Could not populate Response JSON: " + LOGGER.getAsString(data), e); } catch (IOException e) { throw new ActionException("Could not populate Response JSON: " + LOGGER.getAsString(data), e); } }

Target:
public void handleAction(final ActionParameters params) throws ActionException { final int id = params.getRequiredParamInt(PARAM_ID); final OskariLayer oskariLayer = mapLayerService.find(id); if (oskariLayer == null) { throw new ActionParamsException("Layer not found, id: " + id); } String url = oskariLayer.getUrl(); String wmsUrl = Helpers.getGetFeatureInfoUrlForProxy(url, params.getHttpParam(PARAM_SRS), params.getHttpParam(PARAM_BBOX), params.getHttpParam(PARAM_WIDTH), params.getHttpParam(PARAM_HEIGHT), params.getHttpParam(PARAM_X), params.getHttpParam(PARAM_Y), params.getHttpParam(PARAM_LAYERS)); LOGGER.debug("Details of the data cropping feature"); try { HttpURLConnection con = IOHelper.getConnection(wmsUrl); con.setRequestProperty("Accept-Charset", "UTF-8"); final String data = IOHelper.readString(con, "UTF-8"); JSONObject json = new JSONObject(data); ResponseHelper.writeResponse(params, json); } catch (JSONException e) { throw new ActionException("Could not get cropping:", e); } catch (MalformedURLException e) { throw new ActionException("Could not get cropping:", e); } catch (IOException e) { throw new ActionException("Could not get cropping:", e); } }
Source:
void submitGetBlobOperation(String blobIdStr, GetBlobOptionsInternal options, Callback<GetBlobResultInternal> callback) throws RouterException { GetOperation getOperation; BlobId blobId = RouterUtils.getBlobIdFromString(blobIdStr, clusterMap); boolean isEncrypted = BlobId.isEncrypted(blobIdStr); if (blobId.getDatacenterId() != ClusterMapUtils.UNKNOWN_DATACENTER_ID && blobId.getDatacenterId() != clusterMap.getLocalDatacenterId()) { routerMetrics.getBlobNotOriginateLocalOperationRate.mark(); } trackGetBlobRateMetrics(options.getBlobOptions, isEncrypted); routerMetrics.operationQueuingRate.mark(); if (options.getBlobOptions.getOperationType() == GetBlobOptions.OperationType.BlobInfo) { getOperation = new GetBlobInfoOperation(routerConfig, routerMetrics, clusterMap, responseHandler, blobId, options, callback, routerCallback, kms, cryptoService, cryptoJobHandler, time, isEncrypted); } else { getOperation = new GetBlobOperation(routerConfig, routerMetrics, clusterMap, responseHandler, blobId, options, callback, routerCallback, blobIdFactory, kms, cryptoService, cryptoJobHandler, time, isEncrypted); } getOperations.add(getOperation); }

Target:
void submitGetBlobOperation(String blobIdStr, GetBlobOptionsInternal options, Callback<GetBlobResultInternal> callback) throws RouterException { GetOperation getOperation; BlobId blobId = RouterUtils.getBlobIdFromString(blobIdStr, clusterMap); boolean isEncrypted = false; try { BlobId.isEncrypted(blobIdStr); } catch (IOException e) { logger.warn( "This shouldn't happen because getBlobIdFromString() should have thrown RouterException for this case.", e); } if (blobId.getDatacenterId() != ClusterMapUtils.UNKNOWN_DATACENTER_ID && blobId.getDatacenterId() != clusterMap.getLocalDatacenterId()) { routerMetrics.getBlobNotOriginateLocalOperationRate.mark(); } trackGetBlobRateMetrics(options.getBlobOptions, isEncrypted); if (options.getBlobOptions.getOperationType() == GetBlobOptions.OperationType.BlobInfo) { getOperation = new GetBlobInfoOperation(routerConfig, routerMetrics, clusterMap, responseHandler, blobId, options, callback, routerCallback, kms, cryptoService, cryptoJobHandler, time, isEncrypted); } else { getOperation = new GetBlobOperation(routerConfig, routerMetrics, clusterMap, responseHandler, blobId, options, callback, routerCallback, blobIdFactory, kms, cryptoService, cryptoJobHandler, time, isEncrypted); } getOperations.add(getOperation); }
Source:
private void lockEntities() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntityStatus(getSnapshot(), getSnapshot().getStatus()); getSnapshotDao().updateStatus(sourceSnapshotId, SnapshotStatus.LOCKED); lockVmWithCompensationIfNeeded(); getCompensationContext().stateChanged(); return null; } }); }

Target:
private void lockEntities() { TransactionSupport.executeInNewTransaction(new TransactionMethod<Void>() { @Override public Void runInTransaction() { getCompensationContext().snapshotEntityStatus(getSnapshot(), getSnapshot().getStatus()); getSnapshotDao().updateStatus(sourceSnapshotId, SnapshotStatus.LOCKED); lockVmWithCompensationIfNeeded(); getCompensationContext().stateChanged(); return null; } }); freeLock(); }
Source:
protected Path toPath(String key, boolean actionResult) { String cacheFolder = actionResult ? "ac" : "cas"; return root.getChild(cacheFolder).getChild(key.substring(0, 2)).getChild(key); }

Target:
protected Path toPath(String key, boolean actionResult) { String cacheFolder = actionResult ? AC_DIRECTORY : CAS_DIRECTORY; return root.getChild(cacheFolder).getChild(key.substring(0, 2)).getChild(key); }
Source:
public LockingResult acquireLockWait(EngineLock lock, long timeoutMillis) { log.debug("Before acquiring wait or timeout lock '{}'", lock); validateLockForAcquireAndWait(lock); if (timeoutMillis <= 0) { throw new IllegalArgumentException("timeout must be positive"); } long timeoutNanos = TimeUnit.MILLISECONDS.toNanos(timeoutMillis); LockingResult lockAcquired = LockingResult.fail(Set.of()); globalLock.lock(); try { do { lockAcquired = acquireLockInternal(lock); if (!lockAcquired.isAcquired()) { if (timeoutNanos <= 0L) { log.info("Failed to acquire lock because timeout was reached. lock {}", lock); break; } log.info("Failed to acquire lock, will try again until timeout. lock '{}'", lock); timeoutNanos = releasedLock.awaitNanos(timeoutNanos); } } while (!lockAcquired.isAcquired()); } catch (InterruptedException ignore) { log.info("Acquire lock operation was interrupted. lock '{}'", lock); } finally { globalLock.unlock(); } return lockAcquired; }

Target:
public LockingResult acquireLockWait(EngineLock lock, long timeoutMillis) { log.debug("Before acquiring wait or timeout lock '{}'", lock); validateLockForAcquireAndWait(lock); if (timeoutMillis <= 0) { throw new IllegalArgumentException("timeout must be positive"); } long timeoutNanos = TimeUnit.MILLISECONDS.toNanos(timeoutMillis); LockingResult lockAcquired = LockingResult.fail(); globalLock.lock(); try { do { lockAcquired = acquireLockInternal(lock); if (!lockAcquired.isAcquired()) { if (timeoutNanos <= 0L) { log.info("Failed to acquire lock because timeout was reached. lock {}", lock); break; } log.info("Failed to acquire lock, will try again until timeout. lock '{}'", lock); timeoutNanos = releasedLock.awaitNanos(timeoutNanos); } } while (!lockAcquired.isAcquired()); } catch (InterruptedException ignore) { log.info("Acquire lock operation was interrupted. lock '{}'", lock); } finally { globalLock.unlock(); } return lockAcquired; }
Source:
public void testGetVersion() throws Exception { Assert.assertEquals(carbonConfiguration.getVersion(), "5.0.0-SNAPSHOT"); }

Target:
public void testGetVersion() throws Exception { Assert.assertEquals(carbonConfiguration.getVersion(), "1.2.3"); }
Source:
private void validateOCLocation() { if( selectedConnection != null ) { String ocValString = OCBinary.getInstance().getLocation(selectedConnection); if( ocValString == null || ocValString.isEmpty()) { ocLocationDecorator.show(); ocLocationDecorator.setImage(FieldDecorationRegistry.getDefault().getFieldDecoration(FieldDecorationRegistry.DEC_WARNING).getImage()); ocLocationDecorator.setDescriptionText("The selected connection does not have an 'oc' command associated with it. Please edit the connection or modify your workspace settings to add one."); } else { ocLocationDecorator.hide(); } } }

Target:
private void validateOCLocation() { if (selectedConnection != null) { String ocValString = OCBinary.getInstance().getLocation(selectedConnection); if (StringUtils.isEmpty(ocValString)) { ocLocationDecorator.show(); ocLocationDecorator.setImage(FieldDecorationRegistry.getDefault() .getFieldDecoration(FieldDecorationRegistry.DEC_WARNING).getImage()); ocLocationDecorator.setDescriptionText( "The selected connection does not have an 'oc' command associated with it. Please edit the connection or modify your workspace settings to add one."); } else { ocLocationDecorator.hide(); } } }
Source:
public void testGenerate(Path path) throws Exception { Path rootPath = getResourcePath(""); Path relativePath = rootPath.relativize(path); String testPath = relativePath.toString().replace( relativePath.getFileSystem().getSeparator(), "_"); File outputFolder = new File(outputFolderRoot, testPath); final SwiftGeneratorConfig config = SwiftGeneratorConfig.builder() .inputBase(Resources.getResource(TestSwiftGenerator.class, "/").toURI()) .outputFolder(outputFolder) .generateIncludedCode(true) .codeFlavor("java-immutable") .defaultPackage("com.facebook.swift") .addTweak(SwiftGeneratorTweak.ADD_CLOSEABLE_INTERFACE) .addTweak(SwiftGeneratorTweak.EXTEND_RUNTIME_EXCEPTION) .addTweak(SwiftGeneratorTweak.ADD_THRIFT_EXCEPTION) .addTweak(SwiftGeneratorTweak.USE_PLAIN_JAVA_NAMESPACE) .build(); final SwiftGenerator generator = new SwiftGenerator(config); generator.parse(Collections.singletonList(path.toUri())); }

Target:
public void testGenerate(Path path) throws Exception { Path rootPath = getResourcePath(""); Path relativePath = rootPath.relativize(path); String testPath = relativePath.toString().replace( relativePath.getFileSystem().getSeparator(), "_"); File outputDirectory = new File(outputFolderRoot, testPath); File sourceDirectory = new File(outputDirectory, "source"); File classesDirectory = new File(outputDirectory, "classes"); final SwiftGeneratorConfig config = SwiftGeneratorConfig.builder() .inputBase(Resources.getResource(getClass(), "/").toURI()) .outputFolder(sourceDirectory) .generateIncludedCode(true) .codeFlavor("java-immutable") .defaultPackage("com.facebook.swift") .addTweak(SwiftGeneratorTweak.ADD_CLOSEABLE_INTERFACE) .addTweak(SwiftGeneratorTweak.EXTEND_RUNTIME_EXCEPTION) .addTweak(SwiftGeneratorTweak.ADD_THRIFT_EXCEPTION) .addTweak(SwiftGeneratorTweak.USE_PLAIN_JAVA_NAMESPACE) .build(); final SwiftGenerator generator = new SwiftGenerator(config); generator.parse(Collections.singletonList(path.toUri())); assertCompilation( sourceDirectory.toPath(), classesDirectory.toPath()); }
Source:
protected void createServerTemplateWithContainer() { serverTemplate = new ServerTemplate(); serverTemplate.setName("test server"); serverTemplate.setId(UUID.randomUUID().toString()); Map<Capability, ContainerConfig> configs = new HashMap<Capability, ContainerConfig>(); ruleConfig = new RuleConfig(); ruleConfig.setPollInterval(1000l); ruleConfig.setScannerStatus(KieScannerStatus.STARTED); configs.put(Capability.RULE, ruleConfig); processConfig = new ProcessConfig(); processConfig.setKBase("defaultKieBase"); processConfig.setKSession("defaultKieSession"); processConfig.setMergeMode("MERGE_COLLECTION"); processConfig.setRuntimeStrategy("PER_PROCESS_INSTANCE"); configs.put(Capability.PROCESS, processConfig); containerSpec = new ContainerSpec(); containerSpec.setId("test container"); containerSpec.setServerTemplateKey(new ServerTemplateKey(serverTemplate.getId(), serverTemplate.getName())); containerSpec.setReleasedId(new ReleaseId("org.kie", "kie-server-kjar", "1.0")); containerSpec.setStatus(KieContainerStatus.STOPPED); containerSpec.setConfigs(configs); serverTemplate.addContainerSpec(containerSpec); container = new Container(); container.setServerInstanceId(serverTemplate.getId()); container.setServerTemplateId(serverTemplate.getId()); container.setResolvedReleasedId(containerSpec.getReleasedId()); container.setContainerName(containerSpec.getContainerName()); container.setContainerSpecId(containerSpec.getId()); container.setUrl("<LINK_0>"); }

Target:
protected void createServerTemplateWithContainer() { serverTemplate = new ServerTemplate(); serverTemplate.setName("test server"); setServerTemplateId(); Map<Capability, ContainerConfig> configs = new HashMap<Capability, ContainerConfig>(); ruleConfig = new RuleConfig(); ruleConfig.setPollInterval(1000l); ruleConfig.setScannerStatus(KieScannerStatus.STARTED); configs.put(Capability.RULE, ruleConfig); processConfig = new ProcessConfig(); processConfig.setKBase("defaultKieBase"); processConfig.setKSession("defaultKieSession"); processConfig.setMergeMode("MERGE_COLLECTION"); processConfig.setRuntimeStrategy("PER_PROCESS_INSTANCE"); configs.put(Capability.PROCESS, processConfig); containerSpec = new ContainerSpec(); containerSpec.setId("test container"); containerSpec.setServerTemplateKey(new ServerTemplateKey(serverTemplate.getId(), serverTemplate.getName())); containerSpec.setReleasedId(new ReleaseId("org.kie", "kie-server-kjar", "1.0")); containerSpec.setStatus(KieContainerStatus.STOPPED); containerSpec.setConfigs(configs); serverTemplate.addContainerSpec(containerSpec); container = new Container(); container.setServerInstanceId(serverTemplate.getId()); container.setServerTemplateId(serverTemplate.getId()); container.setResolvedReleasedId(containerSpec.getReleasedId()); container.setContainerName(containerSpec.getContainerName()); container.setContainerSpecId(containerSpec.getId()); container.setUrl("<LINK_0>"); }
Source:
public WordsInDocumentByDirectory(String directory, String[] exceptions, boolean shuffle, long seed) { File d = new File(directory); if (!d.exists() || !d.isDirectory()) { logger.error( "Error: '" + directory + "' does not exist or is not a directory."); new Exception().printStackTrace(); System.exit(1); } final String[] e = exceptions == null ? new String[0] : exceptions; Arrays.sort(e); File[] ds = d.listFiles( new FileFilter() { public boolean accept(File f) { return f.isDirectory() && Arrays.binarySearch(e, f.getName()) < 0; } }); files = new ArrayList<>(); for (File d1 : ds) { File[] fs = d1.listFiles( new FileFilter() { public boolean accept(File f) { return f.isFile(); } }); Collections.addAll(files, fs); } if (shuffle) { Random random = seed < 0 ? new Random() : new Random(seed); Collections.shuffle(files, random); } }

Target:
public WordsInDocumentByDirectory(String directory, String[] exceptions, boolean shuffle, long seed) { File d = new File(directory); if (!d.exists() || !d.isDirectory()) { System.err.println( "Error: '" + directory + "' does not exist or is not a directory."); new Exception().printStackTrace(); System.exit(1); } final String[] e = exceptions == null ? new String[0] : exceptions; Arrays.sort(e); File[] ds = d.listFiles( new FileFilter() { public boolean accept(File f) { return f.isDirectory() && Arrays.binarySearch(e, f.getName()) < 0; } }); files = new ArrayList<>(); for (File d1 : ds) { File[] fs = d1.listFiles( new FileFilter() { public boolean accept(File f) { return f.isFile(); } }); Collections.addAll(files, fs); } if (shuffle) { Random random = seed < 0 ? new Random() : new Random(seed); Collections.shuffle(files, random); } }
Source:
public void init() throws Exception { queryRunner = queryRunner != null ? queryRunner : queryRunnerSupplier.get(); h2QueryRunner = new H2QueryRunner(); sqlParser = new SqlParser(); costCalculator = new CoefficientBasedCostCalculator(queryRunner.getMetadata()); }

Target:
public void init() throws Exception { queryRunner = queryRunnerSupplier.get(); h2QueryRunner = new H2QueryRunner(); sqlParser = new SqlParser(); costCalculator = new CoefficientBasedCostCalculator(queryRunner.getMetadata()); }
Source:
public static Collection<SourceUnit> findAllSourceUnits(String repoURI) throws IOException { if (LOGGER.isDebugEnabled()) { LOGGER.debug("Retrieving source units"); } Set<Path> gradleFiles = new LinkedHashSet<>(); File rootGradleFile = new File("build.gradle"); if (rootGradleFile.exists() && !rootGradleFile.isDirectory()) { gradleFiles.add(rootGradleFile.toPath().toAbsolutePath().normalize()); }else { rootGradleFile = new File("settings.gradle"); if (rootGradleFile.exists() && !rootGradleFile.isDirectory()) { gradleFiles.add(rootGradleFile.toPath().toAbsolutePath().normalize()); } } gradleFiles.addAll(ScanUtil.findMatchingFiles("build.gradle")); Set<SourceUnit> units = new LinkedHashSet<>(); Set<Path> visited = new HashSet<>(); for (Path gradleFile : gradleFiles) { gradleFile = gradleFile.toAbsolutePath().normalize(); if (visited.contains(gradleFile)) { continue; } if (LOGGER.isDebugEnabled()) { LOGGER.debug("Processing Gradle file {}", gradleFile); } visited.add(gradleFile); try { units.addAll(createSourceUnits(gradleFile, repoURI, visited)); } catch (Exception e) { LOGGER.warn("An error occurred while processing Gradle file {}", gradleFile, e); } } if (LOGGER.isDebugEnabled()) { LOGGER.debug("Resolving source unit dependencies"); } try { collectSourceUnitsDependencies(units); } catch (Exception e) { LOGGER.warn("An error occurred while resolving source unit dependencies", e); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("Resolved source unit dependencies"); } if (LOGGER.isDebugEnabled()) { LOGGER.debug("Retrieved source units"); } return units; }

Target:
public static Collection<SourceUnit> findAllSourceUnits(String repoURI) throws IOException { LOGGER.debug("Retrieving source units"); Set<Path> gradleFiles = new LinkedHashSet<>(); File rootGradleFile = new File("build.gradle"); if (rootGradleFile.exists() && !rootGradleFile.isDirectory()) { gradleFiles.add(rootGradleFile.toPath().toAbsolutePath().normalize()); } else { rootGradleFile = new File("settings.gradle"); if (rootGradleFile.exists() && !rootGradleFile.isDirectory()) { gradleFiles.add(rootGradleFile.toPath().toAbsolutePath().normalize()); } } gradleFiles.addAll(ScanUtil.findMatchingFiles("build.gradle")); Set<SourceUnit> units = new LinkedHashSet<>(); Set<Path> visited = new HashSet<>(); for (Path gradleFile : gradleFiles) { gradleFile = gradleFile.toAbsolutePath().normalize(); if (visited.contains(gradleFile)) { continue; } LOGGER.debug("Processing Gradle file {}", gradleFile); visited.add(gradleFile); try { units.addAll(createSourceUnits(gradleFile, repoURI, visited)); } catch (Exception e) { LOGGER.warn("An error occurred while processing Gradle file {}", gradleFile, e); } } LOGGER.debug("Resolving source unit dependencies"); try { collectSourceUnitsDependencies(units); } catch (Exception e) { LOGGER.warn("An error occurred while resolving source unit dependencies", e); } LOGGER.debug("Resolved source unit dependencies"); LOGGER.debug("Retrieved source units"); return units; }
Source:
public static KFunction<?> findKotlinFunction(Method method) { KFunction<?> kotlinFunction = ReflectJvmMapping.getKotlinFunction(method); if (kotlinFunction == null) { return findKFunction(method).orElse(null); } return kotlinFunction; }

Target:
public static KFunction<?> findKotlinFunction(Method method) { KFunction<?> kotlinFunction = ReflectJvmMapping.getKotlinFunction(method); return kotlinFunction == null ? findKFunction(method).orElse(null) : kotlinFunction; }
Source:
void validatePersistentResult(QueryResult resultset, QueryHandle handle, boolean isDir) throws IOException { if (resultset instanceof InMemoryQueryResult) { validateInmemoryResult((InMemoryQueryResult) resultset); } }

Target:
void validatePersistentResult(QueryResult resultset, QueryHandle handle, boolean isDir) throws IOException { if (resultset instanceof InMemoryQueryResult) { validateInmemoryResult((InMemoryQueryResult) resultset); } else if (resultset instanceof PersistentQueryResult) { LOG.info(">> Validating persistent query result " + ((PersistentQueryResult) resultset).getPersistedURI()); List<String> rows = readResultSet((PersistentQueryResult) resultset, handle, isDir); assertEquals(rows.size(), NUM_RECORDS); } }
Source:
public ConnectorBucketNodeMap getBucketNodeMap(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorPartitioningHandle partitioningHandle) { return createBucketNodeMap( nodeManager.getRequiredWorkerNodes().size(), value -> { throw new PrestoException(NOT_SUPPORTED, "Black hole connector does not supported distributed reads"); }); }

Target:
public ConnectorBucketNodeMap getBucketNodeMap(ConnectorTransactionHandle transactionHandle, ConnectorSession session, ConnectorPartitioningHandle partitioningHandle) { return createBucketNodeMap(nodeManager.getRequiredWorkerNodes().size()); }
Source:
public void serialize(CloudBlobMetadata value, JsonGenerator gen, SerializerProvider provider) throws IOException { gen.writeStartObject(); gen.writeStringField(FIELD_ID, value.id); gen.writeStringField(FIELD_PARTITION_ID, value.partitionId); gen.writeNumberField(FIELD_ACCOUNT_ID, value.accountId); gen.writeNumberField(FIELD_CONTAINER_ID, value.containerId); gen.writeNumberField(FIELD_SIZE, value.size); if (value.creationTime > 0) { gen.writeNumberField(FIELD_CREATION_TIME, value.creationTime); } if (value.uploadTime > 0) { gen.writeNumberField(FIELD_UPLOAD_TIME, value.uploadTime); } if (value.deletionTime > 0) { gen.writeNumberField(FIELD_DELETION_TIME, value.deletionTime); } if (value.expirationTime > 0) { gen.writeNumberField(FIELD_EXPIRATION_TIME, value.expirationTime); } if (value.namingScheme > 0) { gen.writeNumberField(FIELD_NAMING_SCHEME, value.namingScheme); } if (value.encryptionOrigin == EncryptionOrigin.VCR) { gen.writeStringField(FIELD_ENCRYPTION_ORIGIN, value.encryptionOrigin.toString()); gen.writeStringField(FIELD_VCR_KMS_CONTEXT, value.vcrKmsContext); gen.writeStringField(FIELD_CRYPTO_AGENT_FACTORY, value.cryptoAgentFactory); gen.writeNumberField(FIELD_ENCRYPTED_SIZE, value.encryptedSize); } gen.writeEndObject(); }

Target:
public void serialize(CloudBlobMetadata value, JsonGenerator gen, SerializerProvider provider) throws IOException { gen.writeStartObject(); gen.writeStringField(FIELD_ID, value.id); gen.writeStringField(FIELD_PARTITION_ID, value.partitionId); gen.writeNumberField(FIELD_ACCOUNT_ID, value.accountId); gen.writeNumberField(FIELD_CONTAINER_ID, value.containerId); gen.writeNumberField(FIELD_SIZE, value.size); if (value.creationTime > 0) { gen.writeNumberField(FIELD_CREATION_TIME, value.creationTime); } if (value.uploadTime > 0) { gen.writeNumberField(FIELD_UPLOAD_TIME, value.uploadTime); } if (value.deletionTime > 0) { gen.writeNumberField(FIELD_DELETION_TIME, value.deletionTime); } if (value.expirationTime > 0) { gen.writeNumberField(FIELD_EXPIRATION_TIME, value.expirationTime); } if (value.nameSchemeVersion > 0) { gen.writeNumberField(FIELD_NAME_SCHEME_VERSION, value.nameSchemeVersion); } if (value.encryptionOrigin != EncryptionOrigin.NONE) { gen.writeStringField(FIELD_ENCRYPTION_ORIGIN, value.encryptionOrigin.toString()); if (value.encryptionOrigin == EncryptionOrigin.VCR) { gen.writeStringField(FIELD_ENCRYPTION_ORIGIN, value.encryptionOrigin.toString()); gen.writeStringField(FIELD_VCR_KMS_CONTEXT, value.vcrKmsContext); gen.writeStringField(FIELD_CRYPTO_AGENT_FACTORY, value.cryptoAgentFactory); gen.writeNumberField(FIELD_ENCRYPTED_SIZE, value.encryptedSize); } } gen.writeEndObject(); }
Source:
private okhttp3.Request createRequest(Request request, int networkPolicy) { CacheControl cacheControl = null; if (networkPolicy != 0) { if (NetworkPolicy.isOfflineOnly(networkPolicy)) { cacheControl = CacheControl.FORCE_CACHE; } else { CacheControl.Builder builder = new CacheControl.Builder(); if (!NetworkPolicy.shouldReadFromDiskCache(networkPolicy)) { builder.noCache(); } if (!NetworkPolicy.shouldWriteToDiskCache(networkPolicy)) { builder.noStore(); } cacheControl = builder.build(); } } okhttp3.Request.Builder builder = new okhttp3.Request.Builder().url(request.uri.toString()); if (cacheControl != null) { builder.cacheControl(cacheControl); } return builder.build(); }

Target:
private static okhttp3.Request createRequest(Request request, int networkPolicy) { CacheControl cacheControl = null; if (networkPolicy != 0) { if (NetworkPolicy.isOfflineOnly(networkPolicy)) { cacheControl = CacheControl.FORCE_CACHE; } else { CacheControl.Builder builder = new CacheControl.Builder(); if (!NetworkPolicy.shouldReadFromDiskCache(networkPolicy)) { builder.noCache(); } if (!NetworkPolicy.shouldWriteToDiskCache(networkPolicy)) { builder.noStore(); } cacheControl = builder.build(); } } okhttp3.Request.Builder builder = new okhttp3.Request.Builder().url(request.uri.toString()); if (cacheControl != null) { builder.cacheControl(cacheControl); } return builder.build(); }
Source:
private final int[] decodeInts(final String string) { final int nValues = ParsingUtils.split(string, INT_DECODE_VECTOR, ','); final int[] values = new int[nValues]; try { for ( int i = 0; i < nValues; i++ ) values[i] = Integer.valueOf(INT_DECODE_VECTOR.elementAt(i)); } catch (final NumberFormatException e) { return null; } return values; }

Target:
private final int[] decodeInts(final String string) { final int nValues = ParsingUtils.split(string, INT_DECODE_LIST, ','); final int[] values = new int[nValues]; try { for ( int i = 0; i < nValues; i++ ) values[i] = Integer.valueOf(INT_DECODE_LIST.get(i)); } catch (final NumberFormatException e) { return null; } return values; }
Source:
public List<Optional<TransactionAndImmutableTsLock>> setupRunTaskWithConditionThrowOnConflictBatch( List<PreCommitCondition> conditions) { List<Optional<StartIdentifiedAtlasDbTransactionResponse>> transactionResponses = timelockService.startIdentifiedAtlasDbTransactionBatch(conditions.size()); if (transactionResponses.stream().allMatch(response -> !response.isPresent())) { throw new RuntimeException("entire batch failed"); } List<Optional<TransactionAndImmutableTsLock>> result = Streams.zip(transactionResponses.stream(), conditions.stream(), (response, condition) -> { if (!response.isPresent()) { return Optional.<TransactionAndImmutableTsLock>empty(); } try { return Optional.of(wrap(condition, response.get())); } catch (RuntimeException e) { return Optional.<TransactionAndImmutableTsLock>empty(); } }).collect(Collectors.toList()); return result; }

Target:
public List<TransactionAndImmutableTsLock> setupRunTaskWithConditionThrowOnConflictBatch( List<PreCommitCondition> conditions) { List<StartIdentifiedAtlasDbTransactionResponse> transactionResponses = timelockService.startIdentifiedAtlasDbTransactionBatch(conditions.size()); List<TransactionAndImmutableTsLock> result = new ArrayList<>(); try { Streams.zip(transactionResponses.stream(), conditions.stream(), (response, condition) -> { result.add(wrap(condition, response)); return null; }); } catch (RuntimeException e) { result.forEach(txnAndLock -> timelockService.tryUnlock(ImmutableSet.of(txnAndLock.immutableTsLock()))); throw new TransactionFailedRetriableException("failed to start batch of txns"); } return result; }
Source:
public HttpLookupFailure(DomainBareJid host, Exception exception) { super("Http lookup exception for " + host.toString(), exception); this.host = host; }

Target:
public HttpLookupFailure(DomainBareJid host, Exception exception) { super("Http lookup exception for " + host, exception); this.host = host; }
Source:
protected boolean uniqueInterfaceName(List<VmNetworkInterface> interfaces) { if (!VmHandler.IsNotDuplicateInterfaceName(interfaces, getInterfaceName(), getReturnValue().getCanDoActionMessages())) { return false; } else { return true; } }

Target:
protected boolean uniqueInterfaceName(List<VmNetworkInterface> interfaces) { return VmHandler.IsNotDuplicateInterfaceName(interfaces, getInterfaceName(), getReturnValue().getCanDoActionMessages()); }
Source:
private static List<ExpressionTree> findLiterals(List<ExpressionTree> expressions) { return expressions.stream() .filter(BooleanOrNullLiteralInAssertionsCheck::isBoolOrNullLiteral) .collect(Collectors.toCollection(ArrayList::new)); }

Target:
private static List<LiteralTree> findLiterals(List<ExpressionTree> expressions) { List<LiteralTree> result = new ArrayList<>(); for (ExpressionTree expression : expressions) { getBoolOrNullLiteral(expression).ifPresent(result::add); } return result; }
Source:
public List<FeedbackSessionAttributes> getFeedbackSessionsForUserInCourse( String courseId, String userEmail) throws EntityDoesNotExistException { if (!coursesLogic.isCoursePresent(courseId)) { throw new EntityDoesNotExistException( ERROR_GET_NON_EXISTENT_SESSION_COURSE); } return getFeedbackSessionsForUserInCourseSkipCheck(courseId, userEmail); }

Target:
public List<FeedbackSessionAttributes> getFeedbackSessionsForUserInCourse( String courseId, String userEmail) throws EntityDoesNotExistException { if (!coursesLogic.isCoursePresent(courseId)) { throw new EntityDoesNotExistException(ERROR_NON_EXISTENT_COURSE); } return getFeedbackSessionsForUserInCourseSkipCheck(courseId, userEmail); }
Source:
public void setNewBranchName(String newBranchName) { this.newBranchName = newBranchName; if (myPage != null) myPage.setBranchName(newBranchName); }

Target:
public void setNewBranchName(String newBranchName) { this.newBranchName = newBranchName; if (myPage != null) { myPage.setBranchName(newBranchName); } }
Source:
public IFileRevision[] getContributors(final IFileRevision ifr) { String path = null; RevCommit commit = null; if (ifr instanceof CommitFileRevision) { final CommitFileRevision rev = (CommitFileRevision) ifr; path = rev.getGitPath(); commit = rev.getRevCommit(); } else if (ifr instanceof IAdaptable) { final IResourceVariant variant = (IResourceVariant) ((IAdaptable) ifr) .getAdapter(IResourceVariant.class); if (variant instanceof GitRemoteResource) { final GitRemoteResource gitVariant = (GitRemoteResource) variant; path = gitVariant.getPath(); try { commit = walk.parseCommit(gitVariant.getCommitId()); } catch (IOException e) { } } } if (path != null && commit != null) { final IFileRevision[] r = new IFileRevision[commit.getParentCount()]; for (int i = 0; i < r.length; i++) r[i] = new CommitFileRevision(db, commit.getParent(i), path); return r; } return NO_REVISIONS; }

Target:
public IFileRevision[] getContributors(final IFileRevision ifr) { String path = getGitPath(ifr); RevCommit commit = getRevCommit(ifr); if (path != null && commit != null) { final IFileRevision[] r = new IFileRevision[commit.getParentCount()]; for (int i = 0; i < r.length; i++) r[i] = new CommitFileRevision(db, commit.getParent(i), path); return r; } return NO_REVISIONS; }
Source:
public Set<String> getCacheNames() { OperationsFactory operationsFactory = new OperationsFactory(channelFactory, codec, configuration); String names = await(operationsFactory.newAdminOperation("@@cache@names", Collections.emptyMap()).execute()); Set<String> cacheNames = new HashSet<>(); Pattern pattern = Pattern.compile("(?:\")([^\"]*)(?:\",?)"); Matcher matcher = pattern.matcher(names); while (matcher.find()) { cacheNames.add(matcher.group(1)); } return cacheNames; }

Target:
public Set<String> getCacheNames() { OperationsFactory operationsFactory = new OperationsFactory(channelFactory, codec, configuration); String names = await(operationsFactory.newAdminOperation("@@cache@names", Collections.emptyMap()).execute()); Set<String> cacheNames = new HashSet<>(); Pattern pattern = Pattern.compile(JSON_STRING_ARRAY_ELEMENT_REGEX); Matcher matcher = pattern.matcher(names); while (matcher.find()) { cacheNames.add(matcher.group(1)); } return cacheNames; }