auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public void addSubmitRecords(ChangeAttribute ca, List<SubmitRecord> submitRecords) { ca.submitRecords = new ArrayList<SubmitRecordAttribute>(); for (SubmitRecord submitRecord : submitRecords) { SubmitRecordAttribute sa = new SubmitRecordAttribute(); switch (submitRecord.status) { case OK: sa.status = "OK"; break; case NOT_READY: sa.status = "NOT_READY"; if (!submitRecord.labels.isEmpty()) { sa.labels = new ArrayList<SubmitLabelAttribute>(); for (SubmitRecord.Label lbl : submitRecord.labels) { SubmitLabelAttribute la = new SubmitLabelAttribute(); la.label = lbl.label; switch (lbl.status) { case OK: la.status = "OK"; break; case REJECT: la.status = "REJECT"; break; case NEED: la.status = "NEED"; break; case IMPOSSIBLE: la.status = "IMPOSSIBLE"; break; default: throw new IllegalArgumentException( "Unsupported SubmitRecord.Label.status (" + lbl.status + ")"); } sa.labels.add(la); } } break; case CLOSED: sa.status = "CLOSED"; break; case RULE_ERROR: sa.status = "RULE_ERROR"; break; default: throw new IllegalStateException( "Unsupported SubmitRecord.status + (" + submitRecord.status + ")"); } ca.submitRecords.add(sa); } if (ca.submitRecords.isEmpty()) { ca.submitRecords = null; } }

Target:
public void addSubmitRecords(ChangeAttribute ca, List<SubmitRecord> submitRecords) { ca.submitRecords = new ArrayList<SubmitRecordAttribute>(); for (SubmitRecord submitRecord : submitRecords) { SubmitRecordAttribute sa = new SubmitRecordAttribute(); switch (submitRecord.status) { case OK: sa.status = "OK"; break; case NOT_READY: sa.status = "NOT_READY"; if (!submitRecord.labels.isEmpty()) { sa.labels = new ArrayList<SubmitLabelAttribute>(); for (SubmitRecord.Label lbl : submitRecord.labels) { SubmitLabelAttribute la = new SubmitLabelAttribute(); la.label = lbl.label; switch (lbl.status) { case OK: la.status = "OK"; break; case REJECT: la.status = "REJECT"; break; case NEED: la.status = "NEED"; break; case MAY: la.status = "MAY"; break; case IMPOSSIBLE: la.status = "IMPOSSIBLE"; break; default: throw new IllegalArgumentException( "Unsupported SubmitRecord.Label.status (" + lbl.status + ")"); } sa.labels.add(la); } } break; case CLOSED: sa.status = "CLOSED"; break; case RULE_ERROR: sa.status = "RULE_ERROR"; break; default: throw new IllegalStateException( "Unsupported SubmitRecord.status + (" + submitRecord.status + ")"); } ca.submitRecords.add(sa); } if (ca.submitRecords.isEmpty()) { ca.submitRecords = null; } }
Source:
public String serialize(Protocol protocol) { return "key=value"; }

Target:
public String serialize(Protocol protocol) { return ""; }
Source:
protected Container(String name, long objectCount, long bytesUsed, Optional<Boolean> anybodyRead, Map<String, String> metadata, Multimap<String, String> headers) { this.name = checkNotNull(name, "name"); this.objectCount = objectCount; this.bytesUsed = bytesUsed; this.anybodyRead = anybodyRead == null ? Optional.<Boolean> absent() : anybodyRead; this.metadata = metadata == null ? ImmutableMap.<String, String> of() : metadata; this.headers = headers == null ? ImmutableMultimap.<String, String> of() : checkNotNull(headers, "headers"); }

Target:
protected Container(String name, long objectCount, long bytesUsed, Optional<Boolean> anybodyRead, Map<String, String> metadata, Multimap<String, String> headers) { this.name = checkNotNull(name, "name"); this.objectCount = objectCount; this.bytesUsed = bytesUsed; this.anybodyRead = anybodyRead == null ? Optional.<Boolean> absent() : anybodyRead; this.metadata = metadata == null ? ImmutableMap.<String, String> of() : metadata; this.headers = headers == null ? ImmutableMultimap.<String, String> of() : headers; }
Source:
public void testExecutorEvents() throws Exception { if (!isTestSetup()) { return; } ExecutorLoader loader = createLoader(); int skip = 1; User user = new User("testUser"); Executor executor = new Executor(1, "localhost", 12345); String message = "My message "; EventType[] events = { EventType.CREATED, EventType.HOST_UPDATE, EventType.INACTIVATION }; for (EventType event : events) { loader.postEvent(executor, event, user.getUserId(), message + event.getNumVal()); } List<ExecutorLogEvent> eventLogs = loader.getExecutorEvents(executor, 10, skip); Assert.assertTrue(eventLogs.size() == 2); for (int index = 0; index < eventLogs.size(); ++index) { ExecutorLogEvent eventLog = eventLogs.get(index); Assert.assertEquals(eventLog.getExecutorId(), executor.getId()); Assert.assertEquals(eventLog.getUser(), user.getUserId()); Assert.assertEquals(eventLog.getType(), events[index + skip]); Assert.assertEquals(eventLog.getMessage(), message + events[index + skip].getNumVal()); } clearDB(); }

Target:
public void testExecutorEvents() throws Exception { if (!isTestSetup()) { return; } ExecutorLoader loader = createLoader(); int skip = 1; User user = new User("testUser"); Executor executor = new Executor(1, "localhost", 12345, true); String message = "My message "; EventType[] events = { EventType.CREATED, EventType.HOST_UPDATE, EventType.INACTIVATION }; for (EventType event : events) { loader.postExecutorEvent(executor, event, user.getUserId(), message + event.getNumVal()); } List<ExecutorLogEvent> eventLogs = loader.getExecutorEvents(executor, 10, skip); Assert.assertTrue(eventLogs.size() == 2); for (int index = 0; index < eventLogs.size(); ++index) { ExecutorLogEvent eventLog = eventLogs.get(index); Assert.assertEquals(eventLog.getExecutorId(), executor.getId()); Assert.assertEquals(eventLog.getUser(), user.getUserId()); Assert.assertEquals(eventLog.getType(), events[index + skip]); Assert.assertEquals(eventLog.getMessage(), message + events[index + skip].getNumVal()); } }
Source:
private IjSourceFolder createSourceFolder( IjFolder folder, Path moduleLocationBasePath, @Nullable String packagePrefix) { Path relativeOutputPath = null; ResourceFolderType resourceFolderType = ResourceFolderType.JAVA_RESOURCE; if (folder instanceof JavaResourceFolder) { relativeOutputPath = ((JavaResourceFolder) folder).getRelativeOutputPath().orElse(null); resourceFolderType = ResourceFolderType.JAVA_RESOURCE; } else if (folder instanceof JavaTestResourceFolder) { relativeOutputPath = ((JavaTestResourceFolder) folder).getRelativeOutputPath().orElse(null); resourceFolderType = ResourceFolderType.JAVA_TEST_RESOURCE; } return IjSourceFolder.builder() .setType(folder.getIjName()) .setUrl( IjProjectPaths.toModuleDirRelativeString(folder.getPath(), moduleLocationBasePath)) .setPath(folder.getPath()) .setIsTestSource(folder instanceof TestFolder) .setIsResourceFolder( (folder instanceof AndroidResourceFolder) || (folder instanceof JavaResourceFolder) || (folder instanceof JavaTestResourceFolder)) .setResourceFolderType(resourceFolderType) .setRelativeOutputPath(relativeOutputPath) .setPackagePrefix(packagePrefix) .build(); }

Target:
private IjSourceFolder createSourceFolder( IjFolder folder, Path moduleLocationBasePath, @Nullable String packagePrefix) { Path relativeOutputPath = null; IjResourceFolderType ijResourceFolderType = IjResourceFolderType.JAVA_RESOURCE; if (folder instanceof ResourceFolder) { ResourceFolder resourceFolder = (ResourceFolder) folder; relativeOutputPath = resourceFolder.getRelativeOutputPath(); ijResourceFolderType = resourceFolder.getResourceFolderType(); } return IjSourceFolder.builder() .setType(folder.getIjName()) .setUrl( IjProjectPaths.toModuleDirRelativeString(folder.getPath(), moduleLocationBasePath)) .setPath(folder.getPath()) .setIsTestSource(folder instanceof TestFolder) .setIsResourceFolder(folder.isResourceFolder()) .setIjResourceFolderType(ijResourceFolderType) .setRelativeOutputPath(relativeOutputPath) .setPackagePrefix(packagePrefix) .build(); }
Source:
if (PlatformDependent.javaVersion() >= 11) { final Object maybeException = AccessController.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { try { return Inflater.class.getDeclaredMethod("setInput", ByteBuffer.class); } catch (NoSuchMethodException e) { return e; } catch (SecurityException e) { return e; } } }); if (maybeException instanceof Method) { inflaterSetInput = (Method) maybeException; logger.debug("Inflater.setInput(ByteBuffer): available"); } else { logger.debug("Inflater.setInput(ByteBuffer): available"); } }

Target:
if (PlatformDependent.javaVersion() >= 11) { final Object maybeException = AccessController.doPrivileged(new PrivilegedAction<Object>() { @Override public Object run() { try { return Inflater.class.getDeclaredMethod("setInput", ByteBuffer.class); } catch (NoSuchMethodException e) { return e; } catch (SecurityException e) { return e; } } }); if (maybeException instanceof Method) { inflaterSetInput = (Method) maybeException; logger.debug("Inflater.setInput(ByteBuffer): available"); } else { logger.debug("Inflater.setInput(ByteBuffer): unavailable", maybeException); } }
Source:
public Map<String, Object> initializeLookups(String filePath) throws Exception { String url = StringUtils.format("%slookups/config", getCoordinatorURL()); StatusResponseHolder response = httpClient.go( new Request(HttpMethod.POST, new URL(url)).setContent( "application/json", jsonMapper.writeValueAsBytes(ImmutableMap.of()) ), responseHandler ).get(); if (!response.getStatus().equals(HttpResponseStatus.ACCEPTED)) { throw new ISE( "Error while querying[%s] status[%s] content[%s]", url, response.getStatus(), response.getContent() ); } @SuppressWarnings("unused") Map<String, Object> results = jsonMapper.readValue( response.getContent(), new TypeReference<Map<String, Object>>(){} ); StatusResponseHolder response2 = httpClient.go( new Request(HttpMethod.POST, new URL(url)).setContent( "application/json", jsonMapper.writeValueAsBytes(jsonMapper.readValue(CoordinatorResourceTestClient.class.getResourceAsStream(filePath), new TypeReference<Map<Object, Object>>(){})) ), responseHandler ).get(); if (!response2.getStatus().equals(HttpResponseStatus.ACCEPTED)) { throw new ISE( "Error while querying[%s] status[%s] content[%s]", url, response2.getStatus(), response2.getContent() ); } Map<String, Object> results2 = jsonMapper.readValue( response.getContent(), new TypeReference<Map<String, Object>>() { } ); return results2; }

Target:
public Map<String, Object> initializeLookups(String filePath) throws Exception { String url = StringUtils.format("%slookups/config", getCoordinatorURL()); StatusResponseHolder response = httpClient.go( new Request(HttpMethod.POST, new URL(url)).setContent( "application/json", jsonMapper.writeValueAsBytes(ImmutableMap.of()) ), responseHandler ).get(); if (!response.getStatus().equals(HttpResponseStatus.ACCEPTED)) { throw new ISE( "Error while querying[%s] status[%s] content[%s]", url, response.getStatus(), response.getContent() ); } StatusResponseHolder response2 = httpClient.go( new Request(HttpMethod.POST, new URL(url)).setContent( "application/json", jsonMapper.writeValueAsBytes(jsonMapper.readValue(CoordinatorResourceTestClient.class.getResourceAsStream(filePath), new TypeReference<Map<Object, Object>>(){})) ), responseHandler ).get(); if (!response2.getStatus().equals(HttpResponseStatus.ACCEPTED)) { throw new ISE( "Error while querying[%s] status[%s] content[%s]", url, response2.getStatus(), response2.getContent() ); } Map<String, Object> results2 = jsonMapper.readValue( response.getContent(), new TypeReference<Map<String, Object>>() { } ); return results2; }
Source:
private void addRepeatedAnnotationHandlers( Builder<String, AnnotationHandler> builder, String annotationName, String containerAnnotationName, AnnotationHandler handler) { builder.put(annotationName, handler); builder.put(containerAnnotationName, new RepeatedAnnotationHandler(annotationName, handler)); }

Target:
private static Builder<String, AnnotationHandler> addRepeatedAnnotationHandlers( Builder<String, AnnotationHandler> builder, String annotationName, String containerAnnotationName, AnnotationHandler handler) { builder.put(annotationName, handler); builder.put(containerAnnotationName, new RepeatedAnnotationHandler(annotationName, handler)); return builder; }
Source:
public HttpLogOptions() { logLevel = HttpLogDetailLevel.NONE; allowedHeaderNames = new HashSet<>(Arrays.asList( "x-ms-client-request-id", "x-ms-return-client-request-id", "traceparent", "Accept", "Cache-Control", "Connection", "Content-Length", "Content-Type", "Date", "ETag", "Expires", "If-Match", "If-Modified-Since", "If-None-Match", "If-Unmodified-Since", "Last-Modified", "Pragma", "Request-Id", "Retry-After", "Server", "Transfer-Encoding", "User-Agent" )); allowedQueryParamNames = new HashSet<>(); }

Target:
public HttpLogOptions() { logLevel = HttpLogDetailLevel.NONE; allowedHeaderNames = new HashSet<>(); allowedQueryParamNames = new HashSet<>(DEFAULT_HEADERS_WHITELIST); }
Source:
public static boolean launchIEMIDlet(String midletSuiteVendor, String midletName, int midletNumber, String startupNoteText, String args) { System.out.println("midletSuiteVendor: " + midletSuiteVendor); System.out.println("midletName: " + midletName); System.out.println("midletNumber: " + midletNumber); System.out.println("startupNoteText: " + startupNoteText); System.out.println("args: " + args); BGUtils.launchMIDletCalled = true; BGUtils.waitUserInteraction(); try { BGUtils.addSystemProperties(args); MIDletSuiteUtils.execute(midletNumber, BGUtils.getFGMIDletClass(), null); } catch (Exception e) { System.out.println("Unexpected exception: " + e); e.printStackTrace(); } return true; }

Target:
public static boolean launchIEMIDlet(String midletSuiteVendor, String midletName, int midletNumber, String startupNoteText, String args) { BGUtils.launchMIDletCalled = true; BGUtils.waitUserInteraction(); try { BGUtils.addSystemProperties(args); MIDletSuiteUtils.execute(midletNumber, BGUtils.getFGMIDletClass(), null); } catch (Exception e) { System.out.println("Unexpected exception: " + e); e.printStackTrace(); } return true; }
Source:
public boolean onLongClick(View v) { EditorTools newTool = EditorTools.NONE; switch(v.getId()) { case R.id.editor_tools_marker: newTool = EditorTools.MARKER; break; case R.id.editor_tools_draw: newTool = EditorTools.DRAW; break; case R.id.editor_tools_poly: newTool = EditorTools.POLY; break; case R.id.editor_tools_trash: newTool = EditorTools.TRASH; break; } if(newTool != EditorTools.NONE) { listner.editorToolLongClicked(newTool); } return false; }

Target:
public boolean onLongClick(View v) { EditorTools newTool = EditorTools.NONE; switch (v.getId()) { case R.id.editor_tools_marker: newTool = EditorTools.MARKER; break; case R.id.editor_tools_draw: newTool = EditorTools.DRAW; break; case R.id.editor_tools_poly: newTool = EditorTools.POLY; break; case R.id.editor_tools_trash: newTool = EditorTools.TRASH; break; } if(newTool != EditorTools.NONE) { listener.editorToolLongClicked(newTool); } return false; }
Source:
private void applyDiff(SetDiff<? extends E> diff, Set<E> set) { for (E name : diff.getRemovals()) { set.remove(name); } for (E name : diff.getAdditions()) { set.add(name); } }

Target:
private void applyDiff(SetDiff<? extends E> diff, Set<E> set) { for (E removal : diff.getRemovals()) { set.remove(removal); } for (E addition : diff.getAdditions()) { set.add(addition); } }
Source:
public static OwnCloudVersion getServerVersion(Account account) { OwnCloudVersion serverVersion = null; if (account != null) { FileDataStorageManager fds = new FileDataStorageManager( account, MainApp.getAppContext().getContentResolver() ); OCCapability capability = fds.getCapability(account.name); if (capability != null) { serverVersion = new OwnCloudVersion(capability.getVersionString()); } else { AccountManager accountMgr = AccountManager.get(MainApp.getAppContext()); String serverVersionStr = accountMgr.getUserData(account, Constants.KEY_OC_VERSION); if (serverVersionStr != null) { serverVersion = new OwnCloudVersion(serverVersionStr); } } } return serverVersion; }

Target:
public static OwnCloudVersion getServerVersion(Account account) { OwnCloudVersion serverVersion = null; if (account != null) { FileDataStorageManager fileDataStorageManager = new FileDataStorageManager( account, MainApp.getAppContext().getContentResolver() ); OCCapability capability = fileDataStorageManager.getCapability(account.name); if (capability != null) { serverVersion = new OwnCloudVersion(capability.getVersionString()); } else { AccountManager accountMgr = AccountManager.get(MainApp.getAppContext()); String serverVersionStr = accountMgr.getUserData(account, Constants.KEY_OC_VERSION); if (serverVersionStr != null) { serverVersion = new OwnCloudVersion(serverVersionStr); } } } return serverVersion; }
Source:
static <OFFSET extends ZoneId> OFFSET assertValidZone( Supplier<OFFSET> func ) { try { return func.get(); } catch ( DateTimeParseException e ) { throw new InvalidTemporalArgumentException( e.getMessage(), e ); } }

Target:
static <OFFSET extends ZoneId> OFFSET assertValidZone( Supplier<OFFSET> func ) { try { return func.get(); } catch ( DateTimeException e ) { throw new InvalidValuesArgumentException( e.getMessage(), e ); } }
Source:
public void modifyText( ModifyEvent modifyEvent ) { ExecutorService executorService = ExecutorUtil.getExecutor(); final String runConfiguration = jobMeta.environmentSubstitute( wRunConfiguration.getText() ); executorService.submit( () -> { List<Object> items = Arrays.asList( runConfiguration, false ); try { ExtensionPointHandler.callExtensionPoint( Spoon.getInstance().getLog(), KettleExtensionPoint .RunConfigurationSelection.id, items ); } catch ( KettleException ignored ) { } if ( wWaitingToFinish != null && !wWaitingToFinish.isDisposed() ) { display.asyncExec( () -> { if ( (Boolean) items.get( IS_PENTAHO ) ) { wWaitingToFinish.setSelection( false ); wWaitingToFinish.setEnabled( false ); } else { wWaitingToFinish.setEnabled( true ); } } ); } } ); }

Target:
public void modifyText( ModifyEvent modifyEvent ) { ExecutorService executorService = ExecutorUtil.getExecutor(); final String runConfiguration = jobMeta.environmentSubstitute( wRunConfiguration.getText() ); executorService.submit( () -> { List<Object> items = Arrays.asList( runConfiguration, false ); try { ExtensionPointHandler.callExtensionPoint( Spoon.getInstance().getLog(), KettleExtensionPoint .RunConfigurationSelection.id, items ); } catch ( KettleException ignored ) { } display.asyncExec( () -> { if ( wWaitingToFinish != null && !wWaitingToFinish.isDisposed() ) { if ( (Boolean) items.get( IS_PENTAHO ) ) { wWaitingToFinish.setSelection( false ); wWaitingToFinish.setEnabled( false ); } else { wWaitingToFinish.setEnabled( true ); } } } ); } ); }
Source:
public static List<BlockMetaData> filterRowGroups(Filter filter, List<BlockMetaData> blocks, MessageType schema) { Objects.requireNonNull(filter, "filter"); return filter.accept(new RowGroupFilter(blocks, schema)); }

Target:
public static List<BlockMetaData> filterRowGroups(Filter filter, List<BlockMetaData> blocks, MessageType schema) { Objects.requireNonNull(filter, "filter cannot be null"); return filter.accept(new RowGroupFilter(blocks, schema)); }
Source:
public void reregisterDoesNotLeakTransformer() throws Exception { Converter stringToBanana = new MockConverterBuilder().from(DataTypeFactory.STRING).to(BANANA_DATA_TYPE).build(); stringToBanana.setName("StringToBanana"); Converter copyStringToBanana = new MockConverterBuilder().from(DataTypeFactory.STRING).to(BANANA_DATA_TYPE).build(); copyStringToBanana.setName("StringToBanana"); muleRegistryHelper.registerTransformer(stringToBanana); muleRegistryHelper.registerTransformer(copyStringToBanana); muleRegistryHelper.lookupTransformers(DataTypeFactory.STRING, BANANA_DATA_TYPE); List<Transformer> transformers = muleRegistryHelper.lookupTransformers(DataTypeFactory.STRING, BANANA_DATA_TYPE); assertEquals(1, transformers.size()); }

Target:
public void reregisterDoesNotLeakTransformer() throws Exception { Converter stringToBanana = new MockConverterBuilder().from(STRING).to(BANANA_DATA_TYPE).build(); stringToBanana.setName("StringToBanana"); Converter copyStringToBanana = new MockConverterBuilder().from(STRING).to(BANANA_DATA_TYPE).build(); copyStringToBanana.setName("StringToBanana"); muleRegistryHelper.registerTransformer(stringToBanana); muleRegistryHelper.registerTransformer(copyStringToBanana); muleRegistryHelper.lookupTransformers(DataTypeFactory.STRING, BANANA_DATA_TYPE); List<Transformer> transformers = muleRegistryHelper.lookupTransformers(STRING, BANANA_DATA_TYPE); assertThat(transformers, hasSize(1)); }
Source:
protected final void check() { switch (type()) { case http: HostAndPort host = HostAndPort.fromString(maybeHostAndPort().get()); Preconditions.checkArgument(host.hasPort(), "Given hostname does not contain a port number: " + host); break; case direct: Preconditions.checkArgument(!maybeHostAndPort().isPresent() && !credentials().isPresent(), "Neither credential nor host-and-port may be configured for direct proxies"); break; default: throw new IllegalStateException("Unrecognized case; this is a library bug"); } if (credentials().isPresent()) { Preconditions.checkArgument(type() == Type.http, "credentials only valid for http proxies"); } }

Target:
protected final void check() { switch (type()) { case HTTP: Preconditions.checkArgument(maybeHostAndPort().isPresent(), "host-and-port must be " + "configured for an HTTP proxy"); HostAndPort host = HostAndPort.fromString(maybeHostAndPort().get()); Preconditions.checkArgument(host.hasPort(), "Given hostname does not contain a port number: " + host); break; case DIRECT: Preconditions.checkArgument(!maybeHostAndPort().isPresent() && !credentials().isPresent(), "Neither credential nor host-and-port may be configured for DIRECT proxies"); break; default: throw new IllegalStateException("Unrecognized case; this is a library bug"); } if (credentials().isPresent()) { Preconditions.checkArgument(type() == Type.HTTP, "credentials only valid for http proxies"); } }
Source:
private static boolean isSuppressWarnings(ASTAnnotation astAnnotation) { return TypeHelper.isA(astAnnotation, "java.lang.SuppressWarnings"); }

Target:
private static boolean isSuppressWarnings(ASTAnnotation astAnnotation) { return TypeHelper.isA(astAnnotation, SuppressWarnings.class); }
Source:
public Aes128Cbc() { super(ALGORITHM_NAME, KEY_SIZE); }

Target:
Aes128Cbc() { super(ALGORITHM_NAME, KEY_SIZE); }
Source:
public void testRemove() { tested.put("1", registry1); tested.put("2", registry2); assertTrue(tested.contains("1")); assertTrue(tested.contains("2")); tested.remove("1"); assertFalse(tested.contains("1")); assertTrue(tested.contains("2")); tested.remove("2"); assertFalse(tested.contains("1")); assertFalse(tested.contains("2")); }

Target:
public void testRemove() { tested.put("1", registry1); tested.put("2", registry2); assertTrue(tested.contains("1")); assertTrue(tested.contains("2")); tested.remove("1"); verify(registryDestroyer, times(1)).accept(eq(registry1)); assertFalse(tested.contains("1")); assertTrue(tested.contains("2")); tested.remove("2"); verify(registryDestroyer, times(1)).accept(eq(registry2)); assertFalse(tested.contains("1")); assertFalse(tested.contains("2")); }
Source:
public void startConnection() { if (!isSerialStarted) { usbManager = (UsbManager) getSystemService(Context.USB_SERVICE); HashMap<String, UsbDevice> usbDevices = usbManager.getDeviceList(); if (!usbDevices.isEmpty()) { boolean keep = true; for (Map.Entry<String, UsbDevice> entry : usbDevices.entrySet()) { device = entry.getValue(); int deviceVID = device.getVendorId(); if (isSupportedDeviceID(deviceVID)) { usbManager.requestPermission(device, pendingIntent); keep = false; } else { connection = null; device = null; } if (!keep) { break; } } } } }

Target:
public void startConnection() { if (isSerialStarted) { return; } usbManager = (UsbManager) getSystemService(Context.USB_SERVICE); HashMap<String, UsbDevice> usbDevices = usbManager.getDeviceList(); if (usbDevices.isEmpty()) { return; } boolean supportedDeviceFound = false; for (Map.Entry<String, UsbDevice> entry : usbDevices.entrySet()) { device = entry.getValue(); int deviceVID = device.getVendorId(); if (isSupportedDeviceID(deviceVID)) { usbManager.requestPermission(device, pendingIntent); supportedDeviceFound = true; break; } } if (!supportedDeviceFound) { connection = null; device = null; } }
Source:
@Test public void onlineNodeShouldSucceedOnMaster() throws Exception { final Computer masterComputer = j.jenkins.get().getComputer(""); CLICommandInvoker.Result result = command .authorizedTo(Computer.CONNECT, Jenkins.READ) .invokeWithArgs(""); assertThat(result, succeededSilently()); assertThat(masterComputer.isOnline(), equalTo(true)); result = command .authorizedTo(Computer.CONNECT, Jenkins.READ) .invokeWithArgs(""); assertThat(result, succeededSilently()); assertThat(masterComputer.isOnline(), equalTo(true)); }

Target:
@Test public void onlineNodeShouldSucceedOnMaster() throws Exception { final Computer masterComputer = j.jenkins.getComputer(""); CLICommandInvoker.Result result = command .authorizedTo(Computer.CONNECT, Jenkins.READ) .invokeWithArgs(""); assertThat(result, succeededSilently()); assertThat(masterComputer.isOnline(), equalTo(true)); result = command .authorizedTo(Computer.CONNECT, Jenkins.READ) .invokeWithArgs(""); assertThat(result, succeededSilently()); assertThat(masterComputer.isOnline(), equalTo(true)); }
Source:
private static Autnum createAsBlockResponse(final RpslObject rpslObject) { final Autnum autnum = new Autnum(); String key = rpslObject.getValueForAttribute(AttributeType.AS_BLOCK).toString(); String[] startAndEndKey = key.split("-"); autnum.setHandle(startAndEndKey[0]); autnum.setName(key.replace(" ", "")); autnum.setStartAutnum(Long.parseLong(startAndEndKey[0].trim().substring(2))); autnum.setEndAutnum(Long.parseLong(startAndEndKey[1].trim().substring(2))); autnum.setType("DIRECT ALLOCATION"); autnum.getEntitySearchResults().addAll(createContactEntities(rpslObject)); return autnum; }

Target:
private static Autnum createAsBlockResponse(final RpslObject rpslObject) { final Autnum autnum = new Autnum(); final String key = rpslObject.getValueForAttribute(AttributeType.AS_BLOCK).toString(); final AsBlockRange blockRange = getAsBlockRange(key); autnum.setHandle(blockRange.getBeginWithPrefix()); String asName = String.join("-", blockRange.getBeginWithPrefix(), blockRange.getEndWithPrefix()); autnum.setName(asName); autnum.setStartAutnum(blockRange.getBegin()); autnum.setEndAutnum(blockRange.getEnd()); autnum.setType(DIRECT_ALLOCATION); autnum.getEntitySearchResults().addAll(createContactEntities(rpslObject)); return autnum; }
Source:
public List<JobConfig> getJobConfigs() { String json = ""; try { json = getPlanAsJson(); } catch (Throwable t) { log.warn("Failed to generate plan JSON"); } final String planJson = json; return getJobNodes().stream().map(n -> n.generateConfig(planJson)).collect(Collectors.toList()); }

Target:
public List<JobConfig> getJobConfigs() { String json = ""; try { json = getPlanAsJson(); } catch (Exception e) { log.warn("Failed to generate plan JSON", e); } final String planJson = json; return getJobNodes().stream().map(n -> n.generateConfig(planJson)).collect(Collectors.toList()); }
Source:
@Override public T next() { byte[] data = iterator.next(); try { return converter.from(data); } catch (IOException e) { sneakyRethrow(e); throw new AssertionError(); } }

Target:
@Override public T next() { byte[] data = iterator.next(); try { return converter.from(data); } catch (IOException e) { throw QueueFile.<Error>getSneakyThrowable(e); } }
Source:
public Collection<Object> readData(Configuration conf, Path path) throws IOException { ArrayList<Object> collection = new ArrayList<>(); OrcFile.ReaderOptions readerOptions = new OrcFile.ReaderOptions(conf); Reader reader = OrcFile.createReader(path, readerOptions); RecordReader rows = reader.rows(); Object row = null; for (; rows.hasNext(); ) { row = rows.next(row); collection.add(row); } rows.close(); return collection; }

Target:
public Collection<Object> readData(Configuration conf, Path path) throws IOException { ArrayList<Object> collection = new ArrayList<>(); OrcFile.ReaderOptions readerOptions = new OrcFile.ReaderOptions(conf); Reader reader = OrcFile.createReader(path, readerOptions); RecordReader rows = reader.rows(); Object row = null; while (rows.hasNext()) { row = rows.next(row); collection.add(row); } rows.close(); return collection; }
Source:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } if (getTemplateType() != VmEntityType.INSTANCE_TYPE) { validate(getVirtioRngValidator().canAddRngDevice(getVdsGroup(), getParameters().getRngDevice())); } if (!getRngDevices().isEmpty()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_RNG_ALREADY_EXISTS); } return true; }

Target:
protected boolean canDoAction() { if (!super.canDoAction()) { return false; } if (getTemplateType() != VmEntityType.INSTANCE_TYPE) { if (!validate(getVirtioRngValidator().canAddRngDevice(getVdsGroup(), getParameters().getRngDevice()))) { return false; } } if (!getRngDevices().isEmpty()) { return failCanDoAction(VdcBllMessages.ACTION_TYPE_FAILED_RNG_ALREADY_EXISTS); } return true; }
Source:
public void jsonObjectByBean2() { JSONObject jsonObject = new JSONObject(new MyBeanCustomName()); assertNotNull(jsonObject); assertEquals("Wrong number of keys found:", 5, jsonObject.keySet().size()); assertFalse("Normal field name (someString) processing did not work", jsonObject.has("someString")); assertFalse("Normal field name (myDouble) processing did not work", jsonObject.has("myDouble")); assertFalse("Normal field name (someFloat) processing did not work", jsonObject.has("someFloat")); assertFalse("Ignored field not found!", jsonObject.has("ignoredInt")); assertTrue("Normal field name (someInt) found", jsonObject.has("someInt")); assertTrue("Normal field name (someLong) found", jsonObject.has("someLong")); assertTrue("Overridden String field name (myStringField) found", jsonObject.has("myStringField")); assertTrue("Overridden String field name (Some Weird NAme that Normally Wouldn't be possible!) found", jsonObject.has("Some Weird NAme that Normally Wouldn't be possible!")); assertTrue("Overridden String field name (InterfaceField) found", jsonObject.has("InterfaceField")); }

Target:
public void jsonObjectByBean2() { JSONObject jsonObject = new JSONObject(new MyBeanCustomName()); assertNotNull(jsonObject); assertEquals("Wrong number of keys found:", 5, jsonObject.keySet().size()); assertFalse("Normal field name (someString) processing did not work", jsonObject.has("someString")); assertFalse("Normal field name (myDouble) processing did not work", jsonObject.has("myDouble")); assertFalse("Normal field name (someFloat) processing did not work", jsonObject.has("someFloat")); assertFalse("Ignored field not found!", jsonObject.has("ignoredInt")); assertTrue("Normal field name (someInt) should have been found", jsonObject.has("someInt")); assertTrue("Normal field name (someLong) should have been found", jsonObject.has("someLong")); assertTrue("Overridden String field name (myStringField) should have been found", jsonObject.has("myStringField")); assertTrue("Overridden String field name (Some Weird NAme that Normally Wouldn't be possible!) should have been found", jsonObject.has("Some Weird NAme that Normally Wouldn't be possible!")); assertTrue("Overridden String field name (InterfaceField) should have been found", jsonObject.has("InterfaceField")); }
Source:
void close() { isOpen.set(false); try { chunkFillerThread.join(NonBlockingRouter.SHUTDOWN_WAIT_MS); } catch (InterruptedException e) { logger.error("Caught interrupted exception while waiting for chunkFillerThread to finish"); Thread.currentThread().interrupt(); } Iterator<PutOperation> iter = putOperations.iterator(); while (iter.hasNext()) { PutOperation op = iter.next(); NonBlockingRouter.completeOperation(op.getFuture(), op.getCallback(), null, new RouterException("Aborted operation because Router is closed", RouterErrorCode.RouterClosed)); iter.remove(); } }

Target:
void close() { if (isOpen.compareAndSet(true, false)) { try { chunkFillerThread.join(NonBlockingRouter.SHUTDOWN_WAIT_MS); } catch (InterruptedException e) { logger.error("Caught interrupted exception while waiting for chunkFillerThread to finish"); Thread.currentThread().interrupt(); } completePendingOperations(); } }
Source:
public void start() { if (started.compareAndSet(false, true)) { if (eventGenerator != null) { try { consumer = new KafkaConsumer<>(kafkaConsumerConf); final Collection<String> topicCollection = new LinkedList<>(); topicCollection.add(topic); consumer.subscribe(topicCollection); executorService.submit(new Runnable() { @Override public void run() { try { while(!closed.get()) { final ConsumerRecords<K, V> consumerRecords = consumer.poll(pollTimeout); for (final ConsumerRecord<K, V> record : consumerRecords) { eventGenerator.emitData(record); } } consumer.close(); } catch (final Exception e) { e.printStackTrace(); consumer.close(); } } }); } catch (final Exception e) { e.printStackTrace(); throw new RuntimeException("Failed to construct kafka consumer", e); } } } }

Target:
public void start() { if (started.compareAndSet(false, true)) { if (eventGenerator != null) { try { consumer = new KafkaConsumer<>(kafkaConsumerConf); final Collection<String> topicCollection = new LinkedList<>(); topicCollection.add(topic); consumer.subscribe(topicCollection); executorService.submit(new Runnable() { @Override public void run() { try { while(!closed.get()) { final ConsumerRecords<K, V> consumerRecords = consumer.poll(pollTimeout); for (final ConsumerRecord<K, V> record : consumerRecords) { eventGenerator.emitData(record); } } } catch (final Exception e) { e.printStackTrace(); } finally { consumer.close(); } } }); } catch (final Exception e) { e.printStackTrace(); throw new RuntimeException("Failed to construct kafka consumer", e); } } } }
Source:
private void onButtonOne(boolean action) { List<TagDto> selectedList; if (action) { selectedList = gridStorageR.getSelectionModel().getSelectedItems(); gridStorageR.getSelectionModel().selectNext(false); descriptionPanel.setText(gridStorageR.getSelectionModel().getSelectedItem().getDescription()); gridStorageL.getSelectionModel().deselectAll(); gridStorageL.getStore().addAll(selectedList); for (int i = 0; i < selectedList.size(); i++) { gridStorageR.getStore().remove(selectedList.get(i)); } } else { selectedList = gridStorageL.getSelectionModel().getSelectedItems(); gridStorageL.getSelectionModel().selectNext(false); descriptionPanel.setText(gridStorageL.getSelectionModel().getSelectedItem().getDescription()); gridStorageR.getSelectionModel().deselectAll(); gridStorageR.getStore().addAll(selectedList); for (int i = 0; i < selectedList.size(); i++) { gridStorageL.getStore().remove(selectedList.get(i)); } } }

Target:
private void onButtonOne(boolean action) { if (action) { move(gridStorageL,gridStorageR); } else { move(gridStorageR,gridStorageL); } }
Source:
public void compilePattern(){ if(!isRegularExpression){ stringPayloadPattern = escapeMetaCharacters(stringPayloadPattern); } if (isIgnoreCase) { this.payloadPattern = Pattern.compile(stringPayloadPattern, Pattern.MULTILINE | Pattern.CASE_INSENSITIVE); } else { this.payloadPattern = Pattern.compile(stringPayloadPattern, Pattern.MULTILINE); } }

Target:
private void compilePattern(){ if (ignoreCase) { this.payloadPattern = Pattern.compile(!regularExpression ? Pattern.quote(stringPayloadPattern) : stringPayloadPattern , Pattern.MULTILINE | Pattern.CASE_INSENSITIVE); } else { this.payloadPattern = Pattern.compile(!regularExpression ? Pattern.quote(stringPayloadPattern) : stringPayloadPattern , Pattern.MULTILINE); } }
Source:
private void emitStaticOverloads(String propName, ObjectType objType, JSType propertyType) { if (!objType.isFunctionType()) { return; } ObjectType superType = getSuperType((FunctionType) objType); if (superType == null || superType.getConstructor() == null) { return; } superType = superType.getConstructor(); if (!superType.hasProperty(propName)) { return; } JSType superPropType = superType.getPropertyType(propName); if (!superPropType.equals(propertyType)) { emit(" "); emitBreak(); visitProperty(propName, superType, true); } }

Target:
private void emitStaticOverloads(String propName, ObjectType objType, JSType propertyType) { if (!objType.isFunctionType()) { return; } ObjectType superType = getSuperType((FunctionType) objType); if (superType == null || superType.getConstructor() == null) { return; } FunctionType superTypeCtor = superType.getConstructor(); if (!superTypeCtor.hasProperty(propName)) { return; } JSType superPropType = superTypeCtor.getPropertyType(propName); if (!superPropType.equals(propertyType)) { if (!propertyType.isFunctionType() || !superPropType.isFunctionType()) { throw new IllegalArgumentException("Found a statically declared field that does not match" + "the type of a parent field with the same name, which is illegal in TypeScript.\n" + "at " + objType.getDisplayName() + "." + propName); } emit(" "); emitBreak(); visitProperty(propName, superTypeCtor, true); } }
Source:
public void setContactId(String contactId) { this.contactId = contactId; }

Target:
public LinkedContact setContactId(String contactId) { this.contactId = contactId; return this; }
Source:
public void checkAttributeSemantics(PerunSessionImpl sess, User user, Attribute attribute) throws InternalErrorException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException { Utils.notNull(attribute, "attribute"); try { Attribute a = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, user, VSUP_NAMESPACE); if (!Objects.equals(attribute.getValue(),a.getValue())) { throw new WrongReferenceAttributeValueException(attribute, a, user, null, user, null, "Eduroam login must match VŠUP login "+a.getValue()); } } catch (AttributeNotExistsException ex) { throw new ConsistencyErrorException("Login namespace attribute for VŠUP must exists.", ex); } super.checkAttributeSemantics(sess, user, attribute); }

Target:
public void checkAttributeSemantics(PerunSessionImpl sess, User user, Attribute attribute) throws InternalErrorException, WrongAttributeAssignmentException, WrongReferenceAttributeValueException { try { Attribute a = sess.getPerunBl().getAttributesManagerBl().getAttribute(sess, user, VSUP_NAMESPACE); if (!Objects.equals(attribute.getValue(),a.getValue())) { throw new WrongReferenceAttributeValueException(attribute, a, user, null, user, null, "Eduroam login must match VŠUP login "+a.getValue()); } } catch (AttributeNotExistsException ex) { throw new ConsistencyErrorException("Login namespace attribute for VŠUP must exists.", ex); } super.checkAttributeSemantics(sess, user, attribute); }
Source:
public void onActivityCreated(Bundle savedInstanceState) { Log_OC.i(TAG, "onActivityCreated() start"); super.onActivityCreated(savedInstanceState); mDirectory = mContainerActivity.getCurrentFolder(); mAdapter = new LocalFileListAdapter(mDirectory, isShowingJustFolders(), getActivity()); setListAdapter(mAdapter); if (savedInstanceState != null) { mAdapter.setCheckedFiles(savedInstanceState.getStringArrayList(OUT_STATE_CHECKED_FILES)); mNoOfFilesSelected = savedInstanceState.getIntegerArrayList(OUT_STATE_NO_OF_FILES_SELECTED); } else{ mNoOfFilesSelected = new ArrayList<Integer>(); } Log_OC.i(TAG, "onActivityCreated() stop"); }

Target:
public void onActivityCreated(Bundle savedInstanceState) { Log_OC.i(TAG, "onActivityCreated() start"); super.onActivityCreated(savedInstanceState); mDirectory = mContainerActivity.getCurrentFolder(); mAdapter = new LocalFileListAdapter(mDirectory, isShowingJustFolders(), getActivity()); setListAdapter(mAdapter); if (savedInstanceState != null) { mAdapter.setCheckedFiles(savedInstanceState.getStringArrayList(OUT_STATE_CHECKED_FILES)); mNoOfFilesSelected = savedInstanceState.getIntegerArrayList(OUT_STATE_NO_OF_FILES_SELECTED); } else { mNoOfFilesSelected = new ArrayList<>(); } Log_OC.i(TAG, "onActivityCreated() stop"); }
Source:
protected ResourceResponse createResourceResponse(Attributes attributes, Path path) { try { if (path == null) { throw new WicketRuntimeException( "Please override #newResourceResponse() and provide a path if using a constructor which doesn't take one as argument."); } this.path = path; long size = getSize(); ResourceResponse resourceResponse = new ResourceResponse(); resourceResponse.setContentType(getMimeType()); resourceResponse.setAcceptRange(ContentRangeType.BYTES); resourceResponse.setContentLength(size); if (path != null && path.getFileName() != null) { resourceResponse.setFileName(path.getFileName().toString()); } RequestCycle cycle = RequestCycle.get(); Long startbyte = cycle.getMetaData(CONTENT_RANGE_STARTBYTE); Long endbyte = cycle.getMetaData(CONTENT_RANGE_ENDBYTE); resourceResponse.setWriteCallback( new PartWriterCallback(getInputStream(), size, startbyte, endbyte)); return resourceResponse; } catch (IOException e) { throw new WicketRuntimeException( "An error occurred while processing the media resource response", e); } }

Target:
protected ResourceResponse createResourceResponse(Attributes attributes, Path path) { try { if (path == null) { throw new WicketRuntimeException( "Please override #newResourceResponse() and provide a path if using a constructor which doesn't take one as argument."); } this.path = path; long size = getSize(); ResourceResponse resourceResponse = new ResourceResponse(); resourceResponse.setContentType(getMimeType()); resourceResponse.setAcceptRange(ContentRangeType.BYTES); resourceResponse.setContentLength(size); if (path.getFileName() != null) { resourceResponse.setFileName(path.getFileName().toString()); } RequestCycle cycle = RequestCycle.get(); Long startbyte = cycle.getMetaData(CONTENT_RANGE_STARTBYTE); Long endbyte = cycle.getMetaData(CONTENT_RANGE_ENDBYTE); resourceResponse.setWriteCallback( new PartWriterCallback(getInputStream(), size, startbyte, endbyte)); return resourceResponse; } catch (IOException e) { throw new WicketRuntimeException( "An error occurred while processing the media resource response", e); } }
Source:
public Boolean getHighlyAvailableLocalMaintenance() { return this.mVdsStatistics.getHighlyAvailableLocalMaintenance(); }

Target:
public boolean getHighlyAvailableLocalMaintenance() { return this.mVdsStatistics.getHighlyAvailableLocalMaintenance(); }
Source:
public short getShort(int col) { return col == 2 ? columnNumber : col == 6 ? getTypeSize() : 0; }

Target:
public short getShort(int col) { return shortValues[col]; }
Source:
public void testCompartmentMappingsRecursion() throws Exception { Diagnostician diagnostician = new Diagnostician(); Diagnostic diagnostic = null; DDiagram representation = getRepresentation(VERTICAL_STACK); ContainerMapping parentMapping = getContainerMapping(representation); final ContainerMapping containerMapping = parentMapping.getAllContainerMappings().get(0); changeChildrenPresentation(containerMapping, ContainerLayout.VERTICAL_STACK); diagnostic = diagnostician.validate(modeler); assertEquals("The VSM is not valid, a compartment should not contain a vertical stack container", Diagnostic.ERROR, diagnostic.getSeverity()); undo(); changeChildrenPresentation(containerMapping, ContainerLayout.HORIZONTAL_STACK); diagnostic = diagnostician.validate(modeler); assertEquals("The VSM is not valid, a compartment should not contain a horizontal stack container", Diagnostic.ERROR, diagnostic.getSeverity()); }

Target:
public void testCompartmentMappingsRecursion() throws Exception { Diagnostician diagnostician = new Diagnostician(); Diagnostic diagnostic = null; DDiagram representation = getRepresentation(VERTICAL_STACK); ContainerMapping regionContainerMapping = getContainerMapping(representation); assertEquals("The '" + regionContainerMapping.getName() + "' should displays its children in vertical stack", ContainerLayout.VERTICAL_STACK, regionContainerMapping.getChildrenPresentation()); final ContainerMapping regionMapping = regionContainerMapping.getAllContainerMappings().get(0); changeChildrenPresentation(regionMapping, ContainerLayout.VERTICAL_STACK); diagnostic = diagnostician.validate(modeler); assertEquals("The VSM is not valid, a region container mapping should not contain another region container mapping", Diagnostic.ERROR, diagnostic.getSeverity()); undo(); changeChildrenPresentation(regionMapping, ContainerLayout.HORIZONTAL_STACK); diagnostic = diagnostician.validate(modeler); assertEquals("The VSM is not valid, a region container mapping should not contain another region container mapping", Diagnostic.ERROR, diagnostic.getSeverity()); }
Source:
private Optional<Boolean> maybeGetWorkspaceFileExistence(Environment env, RootedPath directory) throws InterruptedException, LocalRepositoryLookupFunctionException { try { RootedPath workspaceRootedFile = RootedPath.toRootedPath( directory.getRoot(), directory .getRootRelativePath() .getRelative(LabelConstants.WORKSPACE_DOT_BAZEL_FILE_NAME)); if (!workspaceRootedFile.asPath().exists()) { workspaceRootedFile = RootedPath.toRootedPath( directory.getRoot(), directory .getRootRelativePath() .getRelative(LabelConstants.WORKSPACE_FILE_NAME)); } FileValue workspaceFileValue = (FileValue) env.getValueOrThrow(FileValue.key(workspaceRootedFile), IOException.class); if (workspaceFileValue == null) { return Optional.absent(); } if (workspaceFileValue.isDirectory()) { return Optional.of(false); } return Optional.of(workspaceFileValue.exists()); } catch (InconsistentFilesystemException e) { throw new LocalRepositoryLookupFunctionException( new ErrorDeterminingRepositoryException( "InconsistentFilesystemException while checking if there is a WORKSPACE file in " + directory.asPath().getPathString(), e), Transience.PERSISTENT); } catch (FileSymlinkException e) { throw new LocalRepositoryLookupFunctionException( new ErrorDeterminingRepositoryException( "FileSymlinkException while checking if there is a WORKSPACE file in " + directory.asPath().getPathString(), e), Transience.PERSISTENT); } catch (IOException e) { throw new LocalRepositoryLookupFunctionException( new ErrorDeterminingRepositoryException( "IOException while checking if there is a WORKSPACE file in " + directory.asPath().getPathString(), e), Transience.PERSISTENT); } }

Target:
private Optional<Boolean> maybeGetWorkspaceFileExistence(Environment env, RootedPath directory) throws InterruptedException, LocalRepositoryLookupFunctionException { try { RootedPath workspaceRootedFile = WorkspaceFileHelper.getWorkspaceRootedFile(directory, env); if (workspaceRootedFile == null) { return Optional.absent(); } FileValue workspaceFileValue = (FileValue) env.getValueOrThrow(FileValue.key(workspaceRootedFile), IOException.class); if (workspaceFileValue == null) { return Optional.absent(); } if (workspaceFileValue.isDirectory()) { return Optional.of(false); } return Optional.of(workspaceFileValue.exists()); } catch (InconsistentFilesystemException e) { throw new LocalRepositoryLookupFunctionException( new ErrorDeterminingRepositoryException( "InconsistentFilesystemException while checking if there is a WORKSPACE file in " + directory.asPath().getPathString(), e), Transience.PERSISTENT); } catch (FileSymlinkException e) { throw new LocalRepositoryLookupFunctionException( new ErrorDeterminingRepositoryException( "FileSymlinkException while checking if there is a WORKSPACE file in " + directory.asPath().getPathString(), e), Transience.PERSISTENT); } catch (IOException e) { throw new LocalRepositoryLookupFunctionException( new ErrorDeterminingRepositoryException( "IOException while checking if there is a WORKSPACE file in " + directory.asPath().getPathString(), e), Transience.PERSISTENT); } }
Source:
protected String getRegkeyFromRequest() { String regkey = getRequestParamValue(Const.ParamsNames.REGKEY); if (regkey == null) { return getRequestParamValue(Const.ParamsNames.REGKEY_LEGACY); } else { log.severe("TEAMMATES accessed using old join link"); return regkey; } }

Target:
protected String getRegkeyFromRequest() { String regkey = getRequestParamValue(Const.ParamsNames.REGKEY); if (regkey == null) { log.severe("TEAMMATES accessed using old join link"); return getRequestParamValue(Const.ParamsNames.REGKEY_LEGACY); } else { return regkey; } }