auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
public Optional<Alert> get(final UUID identifier, final Organization organization) { assertIsOpen(); LOGGER.debug() .setMessage("Getting alert") .addData("identifier", identifier) .log(); return Optional.empty(); }

Target:
public Optional<Alert> get(final UUID identifier, final Organization organization) { assertIsOpen(); LOGGER.debug() .setMessage("Getting alert") .addData("identifier", identifier) .addData("organization", organization) .log(); return Optional.empty(); }
Source:
public Set<File> getAll() { Set<File> files = new HashSet<>(); if (base.exists()) { for (File low : base.listFiles()) { for (File high: low.listFiles()) { for (File file : high.listFiles()) { files.add(file); } } } } return files; }

Target:
public Set<File> getAll() { Set<File> files = new HashSet<>(); if (base.exists()) { for (File low : Files.list(base)) { for (File high: Files.list(low)) { for (File file : Files.list(high)) { files.add(file); } } } } return files; }
Source:
protected Object getFieldValue(ITmfEvent event, String field) { Object value = null; if (ITmfEvent.EVENT_FIELD_CONTENT.equals(field)) { value = event.getContent().toString(); } else if (ITmfEvent.EVENT_FIELD_TYPE.equals(field)) { value = event.getType().getName(); } else if (ITmfEvent.EVENT_FIELD_TIMESTAMP.equals(field)) { value = event.getTimestamp().toString(); } else if (ITmfEvent.EVENT_FIELD_SOURCE.equals(field)) { value = event.getSource(); } else if (ITmfEvent.EVENT_FIELD_REFERENCE.equals(field)) { value = event.getReference(); } else { if (field == null) { return null; } ITmfEventField eventField; if (field.equals(EMPTY_STRING) || field.charAt(0) != SLASH) { eventField = event.getContent().getField(field); } else { String[] array = getPathArray(field); eventField = event.getContent().getSubField(array); } if (eventField != null) { value = eventField.getValue(); } } return value; }

Target:
protected Object getFieldValue(ITmfEvent event, String field) { Object value = null; if (ITmfEvent.EVENT_FIELD_CONTENT.equals(field)) { value = event.getContent().toString(); } else if (ITmfEvent.EVENT_FIELD_TYPE.equals(field)) { value = event.getType().getName(); } else if (ITmfEvent.EVENT_FIELD_TIMESTAMP.equals(field)) { value = event.getTimestamp().toString(); } else if (ITmfEvent.EVENT_FIELD_SOURCE.equals(field)) { value = event.getSource(); } else if (ITmfEvent.EVENT_FIELD_REFERENCE.equals(field)) { value = event.getReference(); } else { if (field == null) { return null; } ITmfEventField eventField; if (field.isEmpty() || field.charAt(0) != SLASH) { eventField = event.getContent().getField(field); } else { String[] array = getPathArray(field); eventField = event.getContent().getSubField(array); } if (eventField != null) { value = eventField.getValue(); } } return value; }
Source:
public void validate() throws Exception { JenkinsConfig c = jenkins.getConfigPage(); c.configure(); c.numExecutors.set(16); FormValidation formValidation = c.numExecutors.getFormValidation(); assertThat(formValidation, silent()); c.numExecutors.set(-16); formValidation = c.numExecutors.getFormValidation(); assertThat(formValidation, reports(Kind.ERROR, "Not a non-negative number")); }

Target:
public void validate() throws Exception { JenkinsConfig c = jenkins.getConfigPage(); c.configure(); c.numExecutors.set(16); FormValidation formValidation = c.numExecutors.getFormValidation(); assertThat(formValidation, silent()); c.numExecutors.set(-16); formValidation = c.numExecutors.getFormValidation(); String errorMessage = jenkins.getVersion().isNewerThan(new VersionNumber("2.104"))? "Not a non-negative number" : "Not an integer"; assertThat(formValidation, reports(Kind.ERROR, errorMessage)); }
Source:
public static String checkPrefixBeforeAppend(final String checkValue, final String checkPrefix) { final String tempValue = checkValue.toLowerCase(); final String tempPrefix = checkPrefix.toLowerCase(); if(tempValue.indexOf(tempPrefix) == -1){ return MessageFormat.format("{0}{1}", checkPrefix, checkValue); } else { return checkValue; } }

Target:
public static String checkPrefixBeforeAppend(final String checkValue, final String checkPrefix) { final String tempValue = checkValue.trim().toLowerCase(); final String tempPrefix = checkPrefix.toLowerCase(); if(!tempValue.startsWith(tempPrefix)){ return MessageFormat.format("{0}{1}", checkPrefix, checkValue); } else { return checkValue; } }
Source:
public T build(ConfigurationSourceProvider provider, String path) throws IOException, ConfigurationException { try (InputStream input = provider.open(checkNotNull(path))) { final JsonNode node = mapper.readTree(yamlFactory.createParser(input)); if (node == null){ throw ConfigurationParsingException .builder("Configuration file must not be empty") .build(path); } return build(node, path); } catch (YAMLException e) { ConfigurationParsingException.Builder builder = ConfigurationParsingException .builder("Malformed YAML") .setCause(e) .setDetail(e.getMessage()); if (e instanceof MarkedYAMLException) { builder.setLocation(((MarkedYAMLException) e).getProblemMark()); } throw builder.build(path); } }

Target:
public T build(ConfigurationSourceProvider provider, String path) throws IOException, ConfigurationException { try (InputStream input = provider.open(checkNotNull(path))) { final JsonNode node = mapper.readTree(yamlFactory.createParser(input)); if (node == null){ throw ConfigurationParsingException .builder("Configuration at " + path + " must not be empty") .build(path); } return build(node, path); } catch (YAMLException e) { ConfigurationParsingException.Builder builder = ConfigurationParsingException .builder("Malformed YAML") .setCause(e) .setDetail(e.getMessage()); if (e instanceof MarkedYAMLException) { builder.setLocation(((MarkedYAMLException) e).getProblemMark()); } throw builder.build(path); } }
Source:
public UserResource toResource(UserDto user) { UserResource userResource = instantiateResource(user); if (representation != UserResourceRepresentation.MINIMAL || user.getPrivateData().isFetchable()) { addSelfLink(userResource); } if (representation.includeGeneralContent.apply(user)) { addGeneralLinks(userResource); } if (representation.includeOwnUserNumNotConfirmedContent.apply(user)) { addOwnUserNumNotConfirmedLinks(user, userResource); } if (representation.includeOwnUserNumConfirmedContent.apply(user)) { addOwnUserNumConfirmedLinks(userResource); } return userResource; }

Target:
public UserResource toResource(UserDto user) { UserResource userResource = instantiateResource(user); if (user.getPrivateData().isFetchable()) { addSelfLink(userResource); } if (representation.includeGeneralContent.apply(user)) { addGeneralLinks(userResource); } if (representation.includeOwnUserNumNotConfirmedContent.apply(user)) { addOwnUserNumNotConfirmedLinks(user, userResource); } if (representation.includeOwnUserNumConfirmedContent.apply(user)) { addOwnUserNumConfirmedLinks(userResource); } return userResource; }
Source:
public static double distance(int px, int py, int x1, int y1, int x2, int y2) { double length2 = distance2(x1, y1, x2, y2); if (length2 == 0) { return Math.sqrt(distance2(px, py, x1, y1)); } double t = ((px - x1) * (x2 - x1) + (py - y1) * (y2 - y1)) / length2; if (t <= 0.0) { return Math.sqrt(distance2(px, py, x1, y1)); } if (t >= 1.0) { return Math.sqrt(distance2(px, py, x2, y2)); } int x = (int) (x1 + t * (x2 - x1)); int y = (int) (y1 + t * (y2 - y1)); return Math.sqrt(distance2(px, py, x, y)); }

Target:
public static double distance(int px, int py, int x1, int y1, int x2, int y2) { double length2 = distance2(x1, y1, x2, y2); if (length2 == 0) { return Math.sqrt(distance2(px, py, x1, y1)); } double r = ((px - x1) * (x2 - x1) + (py - y1) * (y2 - y1)) / length2; if (r <= 0.0) { return Math.sqrt(distance2(px, py, x1, y1)); } if (r >= 1.0) { return Math.sqrt(distance2(px, py, x2, y2)); } int x = (int) (x1 + r * (x2 - x1)); int y = (int) (y1 + r * (y2 - y1)); return Math.sqrt(distance2(px, py, x, y)); }
Source:
protected void onHandleIntent(Intent intent) { try { ArrayList<String> eventsExtras = intent.getExtras().getStringArrayList(EXTRA_EVENTS); if (eventsExtras != null && eventsExtras.size() > 0) { handleSendEvents(eventsExtras); } else { SwrveLogger.e(LOG_TAG, "SwrveWakefulService: Unknown intent received (extras: " + intent.getExtras().get(EXTRA_EVENTS) + ")."); } } catch (Exception ex) { SwrveLogger.e(LOG_TAG, "SwrveWakefulService exception (intent: " + intent + ") :", ex); } finally { SwrveWakefulReceiver.completeWakefulIntent(intent); } }

Target:
protected void onHandleIntent(Intent intent) { try { ArrayList<String> eventsExtras = intent.getExtras().getStringArrayList(EXTRA_EVENTS); if (eventsExtras != null && eventsExtras.size() > 0) { handleSendEvents(eventsExtras); } else { SwrveLogger.e(LOG_TAG, "SwrveWakefulService: Unknown intent received (extras: " + intent.getExtras() + ")."); } } catch (Exception ex) { SwrveLogger.e(LOG_TAG, "SwrveWakefulService exception (intent: " + intent + ") :", ex); } finally { SwrveWakefulReceiver.completeWakefulIntent(intent); } }
Source:
public void push(FlowStackElement flowStackElement) { if (innerStack.size() >= MAX_DEPTH) { StringBuilder messageBuilder = new StringBuilder(); messageBuilder.append("Too many child contexts nested. ") .append(lineSeparator()) .append(toString()); throw new EventContextDeepNestingException(messageBuilder.toString()); } innerStack.push(flowStackElement); }

Target:
public void push(FlowStackElement flowStackElement) { if (innerStack.size() >= MAX_DEPTH) { StringBuilder messageBuilder = new StringBuilder(); messageBuilder.append("Too many nested child contexts.") .append(lineSeparator()) .append(toString()); throw new EventContextDeepNestingException(messageBuilder.toString()); } innerStack.push(flowStackElement); }
Source:
public static Service getService() { Service service = new Service(); service.setId("1"); service.setName("Dockstore"); service.setType(getServiceType()); service.setDescription("The GA4GH Tool Registry API is a standard for listing and describing available tools (both stand-alone, Docker-based tools as well as workflows in CWL, WDL, Nextflow, or Galaxy) in a given registry,"); service.setOrganization(getOrganization()); service.setContactUrl("<LINK_2>"); service.setDocumentationUrl("<LINK_0>/en/develop"); service.setCreatedAt(new Date()); service.setUpdatedAt(new Date()); service.setEnvironment("prod"); service.setVersion("2.0.1"); return service; }

Target:
public static Service getService() { Service service = new Service(); service.setId("1"); service.setName("Dockstore"); service.setType(getServiceType()); service.setDescription("Dockstore is an implementation of the GA4GH Tool Registry API which is a standard for listing and describing available tools (both stand-alone, Docker-based tools as well as workflows in CWL, WDL, Nextflow, or Galaxy)"); service.setOrganization(getOrganization()); service.setContactUrl("<LINK_2>"); service.setDocumentationUrl("<LINK_0>"); final int createYear = 2020; Date createDate = Date.from(LocalDate.of(createYear, Month.JULY, 2).atStartOfDay(ZoneId.systemDefault()).toInstant()); service.setCreatedAt(createDate); service.setUpdatedAt(UPDATE_DATE); String implVersion = ToolsApiServiceImpl.class.getPackage().getImplementationVersion(); String environment = implVersion == null ? "dev" : "prod"; implVersion = implVersion == null ? DEV_SEM_VER : implVersion; service.setEnvironment(environment); service.setVersion(implVersion); return service; }
Source:
public IStatus validate(IProject project, String path) { File file = new File(path); if (!file.exists()) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "File not found: " + path); } if (!file.isFile()) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Not a file. It's a directory: " + path); } int confidence = 0; try (BufferedRandomAccessFile rafile = new BufferedRandomAccessFile(path, "r")) { int lineCount = 0; int matches = 0; String line = rafile.getNextLine(); while ((line != null) && line.startsWith("#")) { line = rafile.getNextLine(); } while ((line != null) && (lineCount++ < MAX_LINES)) { try { ITmfEvent event = parseLine(0, line); if (event != null) { matches++; } } catch (RuntimeException e) { confidence = Integer.MIN_VALUE; } catch (Exception e) { } confidence = MAX_CONFIDENCE * matches / lineCount; line = rafile.getNextLine(); } } catch (IOException e) { Activator.logError("Error validating file: " + path, e); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "IOException validating file: " + path, e); } return new TraceValidationStatus(confidence, Activator.PLUGIN_ID); }

Target:
public IStatus validate(IProject project, String path) { File file = new File(path); if (!file.exists()) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "File not found: " + path); } if (!file.isFile()) { return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "Not a file. It's a directory: " + path); } int confidence = 0; try (BufferedRandomAccessFile rafile = new BufferedRandomAccessFile(path, "r")) { int lineCount = 0; int matches = 0; String line = rafile.getNextLine(); while ((line != null) && line.startsWith("#")) { line = rafile.getNextLine(); } while ((line != null) && (lineCount++ < MAX_LINES)) { try { ITmfEvent event = parseLine(0, line); if (event != null) { matches++; } } catch (RuntimeException e) { confidence = Integer.MIN_VALUE; } confidence = MAX_CONFIDENCE * matches / lineCount; line = rafile.getNextLine(); } } catch (IOException e) { Activator.logError("Error validating file: " + path, e); return new Status(IStatus.ERROR, Activator.PLUGIN_ID, "IOException validating file: " + path, e); } return new TraceValidationStatus(confidence, Activator.PLUGIN_ID); }
Source:
public static void requestContactPermission(final Activity activity) { requestPermissions(activity, new HashSet<>(Arrays.asList(new Type[]{ Type.CONTACTS }))); }

Target:
public static void requestContactPermission(final Activity activity) { requestPermissions(activity, Collections.singleton(Type.CONTACTS)); }
Source:
public String build(final Path directory, final String name, final ProgressHandler handler, final BuildParameter... params) throws DockerException, InterruptedException, IOException { checkNotNull(handler, "handler"); WebTarget resource = resource().path("build"); for (final BuildParameter param : params) { resource = resource.queryParam(param.queryParam, String.valueOf(param.value)); } if (name != null) { resource = resource.queryParam("t", name); } try (CompressedDirectory compressedDirectory = CompressedDirectory.create(directory); InputStream fileStream = Files.newInputStream(compressedDirectory.file()); ProgressStream build = request(POST, ProgressStream.class, resource, resource.request(APPLICATION_JSON_TYPE), Entity.entity(fileStream, "application/tar"))) { String imageId = null; while (build.hasNextMessage(POST, resource.getUri())) { final ProgressMessage message = build.nextMessage(POST, resource.getUri()); final String id = message.buildImageId(); if (id != null) { imageId = id; } handler.progress(message); } return imageId; } }

Target:
public String build(final Path directory, final String name, final ProgressHandler handler, final BuildParameter... params) throws DockerException, InterruptedException, IOException { checkNotNull(handler, "handler"); WebTarget resource = resource().path("build"); for (final BuildParameter param : params) { resource = resource.queryParam(param.queryParam, String.valueOf(param.value)); } if (name != null) { resource = resource.queryParam("t", name); } try (final CompressedDirectory compressedDirectory = CompressedDirectory.create(directory); final InputStream fileStream = Files.newInputStream(compressedDirectory.file()); final ProgressStream build = request(POST, ProgressStream.class, resource, resource.request(APPLICATION_JSON_TYPE), Entity.entity(fileStream, "application/tar"))) { String imageId = null; while (build.hasNextMessage(POST, resource.getUri())) { final ProgressMessage message = build.nextMessage(POST, resource.getUri()); final String id = message.buildImageId(); if (id != null) { imageId = id; } handler.progress(message); } return imageId; } }
Source:
public boolean tryLock(HoldType type) { while (true) { LockTransition transition = invoke(LockMessaging.tryLock(type)); if (transition.isAcquired()) { currentState = LockMessaging.lock(type); return true; } else { return false; } } }

Target:
public boolean tryLock(HoldType type) { LockTransition transition = invoke(LockMessaging.tryLock(type)); if (transition.isAcquired()) { currentState = LockMessaging.lock(type); return true; } else { return false; } }
Source:
public void setUp(){ final String directoryPath = TARGET_DIR + "cucumber-html-reports/embeddings"; final File dir = new File(directoryPath); if (!dir.exists()) { final boolean created = dir.mkdirs(); if (!created) { Assert.fail("Could not create folder " + directoryPath); } } configuration = new Configuration(new File(TARGET_DIR),"TestProject"); }

Target:
public void setUp() { final String directoryPath = RANDOM_DIR + ReportBuilder.BASE_DIRECTORY + "/embeddings"; final File dir = new File(directoryPath); if (!dir.exists()) { final boolean created = dir.mkdirs(); if (!created) { Assert.fail("Could not create folder " + directoryPath); } } configuration = new Configuration(new File(RANDOM_DIR), "TestProject"); }
Source:
private static void AddEventNotificationEntry(EventNotificationEntity entity, AuditLogType auditLogType) { HashSet<AuditLogType> entry; if (!_eventNotificationTypeMap.containsKey(entity)) { _eventNotificationTypeMap.put(entity, new HashSet<AuditLogType>()); } entry = _eventNotificationTypeMap.get(entity); entry.add(auditLogType); }

Target:
private static void AddEventNotificationEntry(EventNotificationEntity entity, AuditLogType auditLogType) { HashSet<AuditLogType> entry = _eventNotificationTypeMap.get(entity); if (entry == null) { entry = new HashSet<AuditLogType>(); _eventNotificationTypeMap.put(entity, entry); } entry.add(auditLogType); }
Source:
protected Cookie(byte[] cookieBytes) { if (cookieBytes == null || cookieBytes.length == 0) { throw new IllegalArgumentException("Invalid value for cookieBytes passes to Cookie constructor"); } ByteBuffer byteBuffer = ByteBuffer.wrap(cookieBytes); byteBuffer.order(ByteOrder.LITTLE_ENDIAN); byteBuffer.position(byteBuffer.position() + COOKIE_HEAD_SKIP); int urlOffset = byteBuffer.getInt(); int nameOffset = byteBuffer.getInt(); int pathOffset = byteBuffer.getInt(); int valueOffset = byteBuffer.getInt(); byteBuffer.getLong(); expirationDate = byteBuffer.getDouble(); creationDate = byteBuffer.getDouble(); url = decodeString(cookieBytes, urlOffset); name = decodeString(cookieBytes, nameOffset); path = decodeString(cookieBytes, pathOffset); value = decodeString(cookieBytes, valueOffset); }

Target:
protected Cookie(byte[] cookieBytes) { if (cookieBytes == null || cookieBytes.length == 0) { throw new IllegalArgumentException("Invalid value for cookieBytes passed to Cookie constructor"); } ByteBuffer byteBuffer = ByteBuffer.wrap(cookieBytes); byteBuffer.order(ByteOrder.LITTLE_ENDIAN); byteBuffer.position(byteBuffer.position() + COOKIE_HEAD_SKIP); int urlOffset = byteBuffer.getInt(); int nameOffset = byteBuffer.getInt(); int pathOffset = byteBuffer.getInt(); int valueOffset = byteBuffer.getInt(); byteBuffer.getLong(); expirationDate = byteBuffer.getDouble(); creationDate = byteBuffer.getDouble(); url = decodeString(cookieBytes, urlOffset); name = decodeString(cookieBytes, nameOffset); path = decodeString(cookieBytes, pathOffset); value = decodeString(cookieBytes, valueOffset); }
Source:
public static <V> MapStream<V, V> of(Collection<V> collection) { return of(collection.stream(), key -> key); }

Target:
public static <V> MapStream<V, V> of(Collection<V> collection) { return of(collection.stream()); }
Source:
RequestBuilder createRequest() { RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET, restApiBaseUrl); requestBuilder.setHeader("Prefer", "persistent-auth, csrf-protection"); requestBuilder.setHeader("Session-TTL", getSessionTimeout()); if (restApiSessionId != null) { requestBuilder.setHeader(SESSION_ID_HEADER, restApiSessionId); } return requestBuilder; }

Target:
RequestBuilder createRequest() { RequestBuilder requestBuilder = new RequestBuilder(RequestBuilder.GET, restApiBaseUrl); requestBuilder.setHeader("Prefer", "persistent-auth, csrf-protection"); requestBuilder.setHeader("Session-TTL", getSessionTimeout()); String sessionId = getSessionId(); if (sessionId != null) { requestBuilder.setHeader(SESSION_ID_HEADER, sessionId); } return requestBuilder; }
Source:
public void stop() { connectLock.lock(); try { super.stop(); createdStores.clear(); } finally { connectLock.unlock(); } }

Target:
public void stop() { connectLock.lock(); try { createdStores.clear(); } finally { connectLock.unlock(); super.stop(); } }
Source:
private void validateDatasetFieldValues(List<DatasetField> fields) throws JsonParseException { String errors = ""; for (DatasetField dsf : fields) { if (dsf.getDatasetFieldType().isAllowMultiples() && dsf.getControlledVocabularyValues().isEmpty() && dsf.getDatasetFieldCompoundValues().isEmpty() && dsf.getDatasetFieldValues().isEmpty()) { errors += "Empty multiple value for field " + dsf.getDatasetFieldType().getDisplayName() + " "; } else if (!dsf.getDatasetFieldType().isAllowMultiples() && dsf.getSingleValue().getValue().isEmpty()) { errors += "Empty value for field " + dsf.getDatasetFieldType().getDisplayName() + " "; } } if (!errors.isEmpty()) { throw new JsonParseException(errors + " If you would like to delete values please add the parameter replace=true."); } }

Target:
private String validateDatasetFieldValues(List<DatasetField> fields) { StringBuilder error = new StringBuilder(); for (DatasetField dsf : fields) { if (dsf.getDatasetFieldType().isAllowMultiples() && dsf.getControlledVocabularyValues().isEmpty() && dsf.getDatasetFieldCompoundValues().isEmpty() && dsf.getDatasetFieldValues().isEmpty()) { error.append("Empty multiple value for field: ").append(dsf.getDatasetFieldType().getDisplayName()).append(" "); } else if (!dsf.getDatasetFieldType().isAllowMultiples() && dsf.getSingleValue().getValue().isEmpty()) { error.append("Empty value for field: ").append(dsf.getDatasetFieldType().getDisplayName()).append(" "); } } if (!error.toString().isEmpty()) { return (error.toString()); } return ""; }
Source:
public Flux<PartitionEvent> receiveFromPartition(String partitionId, EventPosition startingPosition, ReceiveOptions receiveOptions) { if (Objects.isNull(partitionId)) { return Flux.error(logger.logExceptionAsError(new NullPointerException("'partitionId' cannot be null."))); } else if (partitionId.isEmpty()) { return Flux.error(logger.logExceptionAsError( new IllegalArgumentException("'partitionId' cannot be an empty string."))); } if (Objects.isNull(startingPosition)) { return Flux.error((logger.logExceptionAsError( new NullPointerException("'startingPosition' cannot be null.")))); } final String linkName = StringUtil.getRandomString(partitionId); return createConsumer(linkName, partitionId, startingPosition, receiveOptions); }

Target:
public Flux<PartitionEvent> receiveFromPartition(String partitionId, EventPosition startingPosition, ReceiveOptions receiveOptions) { if (Objects.isNull(partitionId)) { return fluxError(logger, new NullPointerException("'partitionId' cannot be null.")); } else if (partitionId.isEmpty()) { return fluxError(logger, new IllegalArgumentException("'partitionId' cannot be an empty string.")); } if (Objects.isNull(startingPosition)) { return fluxError(logger, new NullPointerException("'startingPosition' cannot be null.")); } final String linkName = StringUtil.getRandomString(partitionId); return createConsumer(linkName, partitionId, startingPosition, receiveOptions); }
Source:
public void start() throws ReplicationException { try { for (String mountPath : partitionGroupedByMountPath.keySet()) { readFromFileAndPersistIfNecessary(mountPath); } logger.info("Number of intra DC replica threads: " + replicationConfig.replicationNumOfIntraDCReplicaThreads); logger.info("Number of intra DC nodes to replicate from: " + replicasToReplicateIntraDC.size()); assignReplicasToThreads(replicasToReplicateIntraDC, replicationConfig.replicationNumOfIntraDCReplicaThreads, replicationIntraDCThreads, "Intra DC", dataNodeId.getDatacenterName()); logger.trace("Assigning thread pools for Inter DC replication"); assignReplicasToThreadPools(replicasToReplicateInterDC, replicationConfig.replicationNumOfInterDCReplicaThreads); for (ReplicaThread thread : replicationIntraDCThreads) { Thread replicaThread = Utils.newThread(thread.getName(), thread, false); logger.info("Starting intra DC replica thread " + thread.getName()); replicaThread.start(); } for (String datacenter : replicaThreadPools.keySet()) { for (ReplicaThread thread : replicaThreadPools.get(datacenter)) { Thread replicaThread = Utils.newThread(thread.getName(), thread, false); logger.info("Starting inter DC replica thread " + thread.getName()); replicaThread.start(); } } this.scheduler.schedule("replica token persistor", persistor, replicationConfig.replicationTokenFlushDelaySeconds, replicationConfig.replicationTokenFlushIntervalSeconds, TimeUnit.SECONDS); } catch (IOException e) { logger.error("IO error while starting replication"); } }

Target:
public void start() throws ReplicationException { try { for (String mountPath : partitionGroupedByMountPath.keySet()) { readFromFileAndPersistIfNecessary(mountPath); } if (dataNodeRemoteReplicaInfosPerDC.size() == 0) { logger.warn("Number of Datacenters to replicate from is 0, not starting any replica threads"); return; } assignReplicasToThreadPool(); for (List<ReplicaThread> replicaThreads : replicaThreadPools.values()) { for (ReplicaThread thread : replicaThreads) { Thread replicaThread = Utils.newThread(thread.getName(), thread, false); logger.info("Starting replica thread " + thread.getName()); replicaThread.start(); } } this.scheduler.schedule("replica token persistor", persistor, replicationConfig.replicationTokenFlushDelaySeconds, replicationConfig.replicationTokenFlushIntervalSeconds, TimeUnit.SECONDS); } catch (IOException e) { logger.error("IO error while starting replication"); } }
Source:
public List<ProjectDTO> getProjectDTOListAsWorkspaceCollaborator(String sUserName) throws QuadrigaStorageException { List<ProjectDTO> projectDTOList = null; try { Query query = sessionFactory .getCurrentSession() .createQuery( "Select projWork.projectDTO from ProjectWorkspaceDTO projWork where projWork.workspaceDTO in (Select wcDTO.workspaceDTO from WorkspaceCollaboratorDTO wcDTO where wcDTO.collaboratorDTOPK.collaboratoruser = :collaboratoruser)"); query.setParameter("collaboratoruser", sUserName); projectDTOList = query.list(); for(ProjectDTO projectDTO :projectDTOList){ System.out.println("Project ID: "+projectDTO.getId()+" , Project Name: "+projectDTO.getProjectname()+" , "+projectDTO.getProjectWorkspaceDTOList().size()); } } catch (Exception e) { logger.info("getProjectListAsWorkspaceCollaborator method :" + e.getMessage()); throw new QuadrigaStorageException(e); } return projectDTOList; }

Target:
public List<ProjectDTO> getProjectDTOListAsWorkspaceCollaborator(String sUserName) throws QuadrigaStorageException { List<ProjectDTO> projectDTOList = null; try { Query query = sessionFactory .getCurrentSession() .createQuery( "Select projWork.projectDTO from ProjectWorkspaceDTO projWork where projWork.workspaceDTO in (Select wcDTO.workspaceDTO from WorkspaceCollaboratorDTO wcDTO where wcDTO.collaboratorDTOPK.collaboratoruser = :collaboratoruser)"); query.setParameter("collaboratoruser", sUserName); projectDTOList = query.list(); } catch (Exception e) { throw new QuadrigaStorageException(e); } return projectDTOList; }
Source:
private void free(FileEntry fe) throws IOException { if (fe != null) { fe.waitUnlocked(); channel.write(ByteBuffer.wrap(ZERO_INT), fe.offset + KEYLEN_POS); if (!freeList.add(fe)) { throw new IllegalStateException(String.format("Trying to free an entry that was not allocated: %s", fe)); } if (trace) log.tracef("Deleted entry at %d:%d, there are now %d free entries", fe.offset, fe.size, freeList.size()); } }

Target:
private void free(FileEntry fe) throws IOException { if (fe != null) { channel.write(ByteBuffer.wrap(ZERO_INT), fe.offset + KEYLEN_POS); if (!freeList.add(fe)) { throw new IllegalStateException(String.format("Trying to free an entry that was not allocated: %s", fe)); } if (trace) log.tracef("Deleted entry at %d:%d, there are now %d free entries", fe.offset, fe.size, freeList.size()); } }
Source:
static void submitComments( AbstractBuild<?, ?> build, PrintStream logger, String jenkinsRootUrl, List<JiraIssue> issues, JiraSession session, boolean useWikiStyleComments, boolean recordScmChanges, String groupVisibility, String roleVisibility) throws RemoteException { List<JiraIssue> copy = new ArrayList<JiraIssue>(issues); StringBuilder issuesWithExceptions = new StringBuilder(); for (JiraIssue issue : copy) { logger.println(Messages.Updater_Updating(issue.id)); try { session.addComment( issue.id, createComment(build, useWikiStyleComments, jenkinsRootUrl, recordScmChanges, issue), groupVisibility, roleVisibility); } catch (RemotePermissionException e) { logger.println("Looks like " + issue.id + " is no valid JIRA issue or you don't have permission to update the issue.\n" + "Issue will not be updated.\n" + e); } catch (RemoteException e) { if( 0 < issuesWithExceptions.length()) { issuesWithExceptions.append(", "); } issuesWithExceptions.append(issue.id); logger.println(e.getLocalizedMessage()); logger.println(Messages.Updater_FailedToCommentOnIssue(issue.id)); continue; } issues.remove(issue); } if( 0 < issuesWithExceptions.length() ) { throw new RemoteException(Messages.Updater_ErrorCommentingIssues(issuesWithExceptions.toString())); } }

Target:
static void submitComments( AbstractBuild<?, ?> build, PrintStream logger, String jenkinsRootUrl, List<JiraIssue> issues, JiraSession session, boolean useWikiStyleComments, boolean recordScmChanges, String groupVisibility, String roleVisibility) throws RemoteException { List<JiraIssue> copy = new ArrayList<JiraIssue>(issues); StringBuilder issuesWithExceptions = new StringBuilder(); for (JiraIssue issue : copy) { logger.println(Messages.Updater_Updating(issue.id)); try { session.addComment( issue.id, createComment(build, useWikiStyleComments, jenkinsRootUrl, recordScmChanges, issue), groupVisibility, roleVisibility); } catch (RemotePermissionException e) { logger.println("Looks like " + issue.id + " is no valid JIRA issue or you don't have permission to update the issue.\n" + "Issue will not be updated.\n" + e); } catch (RemoteException e) { if( issuesWithExceptions.length() > 0) { issuesWithExceptions.append(", "); } issuesWithExceptions.append(issue.id); logger.println(e.getLocalizedMessage()); logger.println(Messages.Updater_FailedToCommentOnIssue(issue.id)); continue; } issues.remove(issue); } if( issuesWithExceptions.length() > 0) { throw new RemoteException(Messages.Updater_ErrorCommentingIssues(issuesWithExceptions.toString())); } }
Source:
public void update(Subscription newSubscription) { this.subscription = subscription; }

Target:
public void update(Subscription newSubscription) { this.subscription = newSubscription; }
Source:
Path getOrDefaultConfigurationDirectory(String configPath) { return configPath != null ? Paths.get(configPath) : ((RawPath)Setting.NODE_CONFIG_DIR.getDefaultValue()).toPath(); }

Target:
Path getOrDefaultConfigurationDirectory(String configPath) { return configPath != null ? Paths.get(configPath) : Setting.NODE_CONFIG_DIR.<RawPath>getDefaultValue().toPath(); }
Source:
public List<AuditEvent> getEvents(int start, int number, String action, String userId, String ip, String entityId, String fromTime, String toTime) { if (this.auth.hasAccess(this.users.getCurrentUser(), Right.ADMIN, this.resolver.resolve(Constants.XWIKI_SPACE_REFERENCE))) { SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy", Locale.ENGLISH); Calendar from = Calendar.getInstance(); try { from.setTime(sdf.parse(fromTime)); } catch (Exception e) { from.setTimeInMillis(0); } Calendar to = Calendar.getInstance(); try { if (to.after(from)) { to.setTime(sdf.parse(toTime)); } else { to.setTimeInMillis(System.currentTimeMillis()); } } catch (Exception e) { to.setTimeInMillis(System.currentTimeMillis()); } DocumentReference entity = entityId != null ? this.resolverd.resolve(entityId) : null; User user = userId != null ? this.users.getUser(userId) : null; String actionId = StringUtils.isNotBlank(action) ? action : null; String ipValue = StringUtils.isNotBlank(ip) ? ip : null; AuditEvent eventTemplate = new AuditEvent(user, ipValue, actionId, null, entity, null); return this.store.getEvents(eventTemplate, from, to, start, number); } return Collections.emptyList(); }

Target:
public List<AuditEvent> getEvents(int start, int number, String action, String userId, String ip, String entityId, String fromTime, String toTime) { if (this.auth.hasAccess(this.users.getCurrentUser(), Right.ADMIN, this.resolver.resolve(Constants.XWIKI_SPACE_REFERENCE))) { Calendar from = null; try { Date d = DATE_FORMAT.parse(fromTime); from = Calendar.getInstance(); from.setTime(d); } catch (Exception e) { } Calendar to = null; try { Date d = DATE_FORMAT.parse(toTime); to = Calendar.getInstance(); to.setTime(d); } catch (Exception e) { } DocumentReference entity = entityId != null ? this.resolverd.resolve(entityId) : null; User user = userId != null ? this.users.getUser(userId) : null; String actionId = StringUtils.isNotBlank(action) ? action : null; String ipValue = StringUtils.isNotBlank(ip) ? ip : null; AuditEvent eventTemplate = new AuditEvent(user, ipValue, actionId, null, entity, null); return this.store.getEvents(eventTemplate, from, to, start, number); } return Collections.emptyList(); }
Source:
private void fetchCenterDetails() { presenter.loadCenterDetails("dd MMMM yyyy", "en", tvMeetingDate.getText().toString(), officeId, staffId); }

Target:
private void fetchCenterDetails() { presenter.loadCenterDetails(Constants.DATE_FORMAT_LONG, Constants.LOCALE_EN, tvMeetingDate.getText().toString(), officeId, staffId); }
Source:
public void makeSureConcurrentDownloadisNotSerialized() throws Exception { String baseUrl = AbstractNexusIntegrationTest.nexusBaseUrl + REPOSITORY_RELATIVE_URL + REPO_TEST_HARNESS_REPO + "/"; String path = getRelitiveArtifactPath( gav ); final URL url = new URL( baseUrl + path ); final long op = ping( url ); final Long[] time = new Long[1]; final Throwable[] errors = new Throwable[1]; Thread t = new Thread( new Runnable() { public void run() { try { long t = System.currentTimeMillis(); read( url, 100 ); time[0] = System.currentTimeMillis() - t; } catch ( Exception e ) { errors[0] = e; time[0] = -1L; } } } ); t.setUncaughtExceptionHandler( new UncaughtExceptionHandler() { public void uncaughtException( Thread t, Throwable e ) { errors[0] = e; } } ); t.setDaemon( true ); t.start(); for ( int i = 0; i < 10; i++ ) { Thread.yield(); Thread.sleep( 1 ); } final long ping = ping( url ); assertTrue( ping < ( op * 2 ), "Ping took " + ping + " original pind " + op ); if ( time[0] != null ) { assertTrue( ping < time[0], "Ping took " + ping + " dl time: " + time[0] ); } assertThat( t.getState(), not( equalTo( State.TERMINATED ) ) ); if ( errors[0] != null ) { ByteArrayOutputStream str = new ByteArrayOutputStream(); PrintStream s = new PrintStream( str ); for ( Throwable e : errors ) { e.printStackTrace( s ); s.append( "\n" ); s.append( "\n" ); } Assert.fail( "Found some errors downloading:\n" + str.toString() ); } t.stop(); }

Target:
public void makeSureConcurrentDownloadisNotSerialized() throws Exception { String baseUrl = AbstractNexusIntegrationTest.nexusBaseUrl + REPOSITORY_RELATIVE_URL + REPO_TEST_HARNESS_REPO + "/"; String path = getRelitiveArtifactPath( gav ); final URL url = new URL( baseUrl + path ); final long op = clockUrlDownload( url ); final Long[] time = new Long[1]; final Throwable[] errors = new Throwable[1]; Thread t = new Thread( new Runnable() { public void run() { try { time[0] = clockUrlDownload( url, 10 ); } catch ( Exception e ) { errors[0] = e; time[0] = -1L; } } } ); t.setUncaughtExceptionHandler( new UncaughtExceptionHandler() { public void uncaughtException( Thread t, Throwable e ) { errors[0] = e; } } ); t.setDaemon( true ); t.start(); for ( int i = 0; i < 10; i++ ) { Thread.yield(); Thread.sleep( 1 ); } final long ping = clockUrlDownload( url ); assertThat( "Ping took " + ping + " original pind " + op, ping, lessThan( op * 2 ) ); if ( time[0] != null ) { assertThat( "Ping took " + ping + " dl time: " + time[0], ping, lessThan( time[0] ) ); } assertThat( t.getState(), not( equalTo( State.TERMINATED ) ) ); if ( errors[0] != null ) { ByteArrayOutputStream str = new ByteArrayOutputStream(); PrintStream s = new PrintStream( str ); for ( Throwable e : errors ) { e.printStackTrace( s ); s.append( "\n" ); s.append( "\n" ); } assertThat( "Found some errors downloading:\n" + str.toString(), false ); } stop( t ); }
Source:
public void testNestedGetTags() throws Exception { class DebugGetTagsHandler implements OneSignal.GetTagsHandler { boolean executed = false; @Override public void tagsAvailable(JSONObject tags) { OneSignal.getTags(new OneSignal.GetTagsHandler() { @Override public void tagsAvailable(JSONObject tags) { } }); executed = true; } } OneSignalInit(); threadAndTaskWait(); DebugGetTagsHandler first = new DebugGetTagsHandler(); OneSignal.getTags(first); threadAndTaskWait(); }

Target:
public void testNestedGetTags() throws Exception { class DebugGetTagsHandler implements OneSignal.GetTagsHandler { boolean executed = false; @Override public void tagsAvailable(JSONObject tags) { OneSignal.getTags(new OneSignal.GetTagsHandler() { @Override public void tagsAvailable(JSONObject tags) { } }); executed = true; } } OneSignalInit(); threadAndTaskWait(); OneSignal.sendTag("test", "value"); threadAndTaskWait(); DebugGetTagsHandler first = new DebugGetTagsHandler(); DebugGetTagsHandler second = new DebugGetTagsHandler(); OneSignal.getTags(first); OneSignal.getTags(second); threadAndTaskWait(); assertTrue(first.executed); assertTrue(second.executed); }
Source:
public void calculatePipelineRoutes(Task task, final Route route, List<Route> allRoutes) { if (task.getDownstreamTasks() != null && task.getDownstreamTasks().size() > 0) { for (String downstreamTaskName: task.getDownstreamTasks()) { Route currentRoute = createRouteAndCopyTasks(route, task); calculatePipelineRoutes(getTaskFromName(downstreamTaskName), currentRoute, allRoutes); } } else { Route currentRoute = createRouteAndCopyTasks(route, task); allRoutes.add(currentRoute); } }

Target:
void calculatePipelineRoutes(Task task, final Route route, List<Route> allRoutes) { if (task.getDownstreamTasks() != null && task.getDownstreamTasks().size() > 0) { for (String downstreamTaskName: task.getDownstreamTasks()) { Route currentRoute = createRouteAndCopyTasks(route, task); calculatePipelineRoutes(getTaskFromName(downstreamTaskName), currentRoute, allRoutes); } } else { Route currentRoute = createRouteAndCopyTasks(route, task); allRoutes.add(currentRoute); } }
Source:
public void setOutOfServiceProxy( final String repoId, final boolean outOfService ) throws Exception { RepositoryStatusResource status = new RepositoryStatusResource(); status.setId( repoId ); status.setRepoType( "proxy" ); if ( outOfService ) { status.setLocalStatus( LocalStatus.OUT_OF_SERVICE.name() ); } else { status.setLocalStatus( LocalStatus.IN_SERVICE.name() ); } Response response = RepositoryStatusMessageUtil.changeStatus( status ); assertThat( "Could not set proxy out of service status (Status: " + response.getStatus() + ": " + repoId + "\n" + response.getEntity().getText(), response, isSuccessful() ); TaskScheduleUtil.waitForAllTasksToStop(); getTest().getEventInspectorsUtil().waitForCalmPeriod(); }

Target:
public void setOutOfServiceProxy( final String repoId, final boolean outOfService ) throws Exception { RepositoryStatusResource status = new RepositoryStatusResource(); status.setId( repoId ); status.setRepoType( "proxy" ); if ( outOfService ) { status.setLocalStatus( LocalStatus.OUT_OF_SERVICE.name() ); } else { status.setLocalStatus( LocalStatus.IN_SERVICE.name() ); } Response response = RepositoryStatusMessageUtil.changeStatus( status ); try { assertThat( "Could not set proxy out of service status (Status: " + response.getStatus() + ": " + repoId + "\n" + response.getEntity().getText(), response, isSuccessful() ); } finally { RequestFacade.releaseResponse( response ); } TaskScheduleUtil.waitForAllTasksToStop(); getTest().getEventInspectorsUtil().waitForCalmPeriod(); }
Source:
Flux<BlobChangefeedEventWrapper> getEvents() { return client.getBlobAsyncClient(path) .download().reduce(new ByteArrayOutputStream(), (os, buffer) -> { try { os.write(FluxUtil.byteBufferToArray(buffer)); } catch (IOException e) { throw logger.logExceptionAsError(new UncheckedIOException(e)); } return os; }) .map(ByteArrayOutputStream::toString) .map(json -> { ObjectMapper objectMapper = new ObjectMapper(); JsonNode jsonNode = null; try { jsonNode = objectMapper.readTree(json); } catch (IOException e) { throw logger.logExceptionAsError(new UncheckedIOException(e)); } List<Flux<BlobChangefeedEventWrapper>> shards = new ArrayList<>(); for (JsonNode shard : jsonNode.withArray("chunkFilePaths")) { String shardPath = shard.asText().substring(BlobChangefeedAsyncClient.CHANGEFEED_CONTAINER_NAME.length() + 1); shards.add(new Shard(client, shardPath, cfCursor.toShardCursor(shardPath), userCursor).getEvents()); } return shards; }) .flatMapMany(this::roundRobinAmongShards); }

Target:
Flux<BlobChangefeedEventWrapper> getEvents() { return DownloadUtils.downloadToString(client, path) .map(json -> { ObjectMapper objectMapper = new ObjectMapper(); JsonNode jsonNode = null; try { jsonNode = objectMapper.readTree(json); } catch (IOException e) { throw logger.logExceptionAsError(new UncheckedIOException(e)); } List<Flux<BlobChangefeedEventWrapper>> shards = new ArrayList<>(); for (JsonNode shard : jsonNode.withArray("chunkFilePaths")) { String shardPath = shard.asText().substring(BlobChangefeedAsyncClient.CHANGEFEED_CONTAINER_NAME.length() + 1); shards.add(new Shard(client, shardPath, cfCursor.toShardCursor(shardPath), userCursor).getEvents()); } return shards; }) .flatMapMany(this::roundRobinAmongShards); }
Source:
public void experimentSelected(TmfExperimentSelectedSignal signal) { if (signal != null) { if (fExperiment == null || signal.getExperiment().toString().compareTo(fExperiment.toString()) != 0) { if (fStatsViewers != null) { fStatsViewers.dispose(); } fExperiment = signal.getExperiment(); fStatsViewers = createStatisticsViewers(); fParent.layout(); TmfStatisticsViewer statViewer; for (ITmfViewer viewer : fStatsViewers.getViewers()) { statViewer = (TmfStatisticsViewer) viewer; setInput(statViewer, fExperiment.getTraces()); } if (fRequestData) { TmfExperimentRangeUpdatedSignal updateSignal = new TmfExperimentRangeUpdatedSignal(null, fExperiment, fExperiment.getTimeRange()); TmfStatisticsViewer statsViewer; for (ITmfViewer viewer : fStatsViewers.getViewers()) { statsViewer = (TmfStatisticsViewer) viewer; statsViewer.experimentRangeUpdated(updateSignal); } fRequestData = false; } } } }

Target:
public void experimentSelected(TmfExperimentSelectedSignal signal) { if (signal != null) { if (fExperiment == null || signal.getExperiment().toString().compareTo(fExperiment.toString()) != 0) { fStatsViewers.clear(); fExperiment = signal.getExperiment(); createStatisticsViewers(); fStatsViewers.layout(); TmfStatisticsViewer statViewer; for (ITmfViewer viewer : fStatsViewers.getViewers()) { statViewer = (TmfStatisticsViewer) viewer; setInput(statViewer, fExperiment.getTraces()); } if (fRequestData) { TmfExperimentRangeUpdatedSignal updateSignal = new TmfExperimentRangeUpdatedSignal(null, fExperiment, fExperiment.getTimeRange()); TmfStatisticsViewer statsViewer; for (ITmfViewer viewer : fStatsViewers.getViewers()) { statsViewer = (TmfStatisticsViewer) viewer; statsViewer.experimentRangeUpdated(updateSignal); } fRequestData = false; } } } }
Source:
public String checkFileContent(File content){ if(checkWDL(content)){ return "wdl"; }else if(checkCWL(content)){ return "cwl"; } return null; }

Target:
public Type checkFileContent(File content){ if(checkWDL(content)){ return Type.WDL; }else if(checkCWL(content)){ return Type.CWL; } return Type.NONE; }
Source:
public static Object readValue( ValueMetaInterface meta, Row row, int i ) { if (row.isNull( i ) ) { return null; } switch ( meta.getType() ) { case ValueMetaInterface.TYPE_INTEGER: case ValueMetaInterface.TYPE_NUMBER: case ValueMetaInterface.TYPE_BIGNUMBER: case ValueMetaInterface.TYPE_BOOLEAN: case ValueMetaInterface.TYPE_DATE: case ValueMetaInterface.TYPE_BINARY: ColumnDefinitions cdef = row.getColumnDefinitions(); switch( cdef.getType( i ).getName() ) { case BIGINT: case COUNTER: return row.getLong( i ); case SMALLINT: return new Long( row.getShort( i ) ); case TINYINT: return new Long( row.getByte( i ) ); case INT: return new Long( row.getInt( i ) ); case FLOAT: return new Double( row.getFloat( i ) ); case DOUBLE: return row.getDouble( i ); case DECIMAL: return row.getDecimal( i ); case VARINT: return new BigDecimal( row.getVarint( i ) ); case BOOLEAN: return row.getBool( i ); case DATE: return new Date( row.getDate( i ).getMillisSinceEpoch() ); case TIMESTAMP: return row.getTimestamp( i ); case TIME: return row.getTime( i ); case BLOB: return row.getBytes( i ).array(); default: return row.getObject( i ); } default: return row.getObject( i ); } }

Target:
public static Object readValue( ValueMetaInterface meta, Row row, int i ) { if ( row.isNull( i ) ) { return null; } switch ( meta.getType() ) { case ValueMetaInterface.TYPE_INTEGER: case ValueMetaInterface.TYPE_NUMBER: case ValueMetaInterface.TYPE_BIGNUMBER: case ValueMetaInterface.TYPE_BOOLEAN: case ValueMetaInterface.TYPE_DATE: case ValueMetaInterface.TYPE_BINARY: ColumnDefinitions cdef = row.getColumnDefinitions(); switch ( cdef.getType( i ).getName() ) { case BIGINT: case COUNTER: return row.getLong( i ); case SMALLINT: return (long) row.getShort( i ); case TINYINT: return (long) row.getByte( i ); case INT: return (long) row.getInt( i ); case FLOAT: return (double) row.getFloat( i ); case DOUBLE: return row.getDouble( i ); case DECIMAL: return row.getDecimal( i ); case VARINT: return new BigDecimal( row.getVarint( i ) ); case BOOLEAN: return row.getBool( i ); case DATE: return new Date( row.getDate( i ).getMillisSinceEpoch() ); case TIMESTAMP: return row.getTimestamp( i ); case TIME: return row.getTime( i ); case BLOB: return row.getBytes( i ).array(); default: return row.getObject( i ); } default: return row.getObject( i ); } }