auphong2707/dl4se-code-review-dataset huggingface dataset:
Source:
private void printRestrictions() { try { TBoxReasonerModule reasoner = ApplicationUtils.instance().getTBoxReasonerModule(); for (Restriction rest : reasoner.listRestrictions() ) { if (rest.isAllValuesFromRestriction()) { log.trace("All values from: "); AllValuesFromRestriction avfr = rest.asAllValuesFromRestriction(); Resource res = avfr.getAllValuesFrom(); if (res.canAs(OntClass.class)) { OntClass resClass = res.as(OntClass.class); for (Resource inst : resClass.listInstances().toList() ) { log.trace(" -"+inst.getURI()); } } } else if (rest.isSomeValuesFromRestriction()) { log.trace("Some values from: "); } else if (rest.isHasValueRestriction()) { log.trace("Has value: "); } log.trace("On property "+rest.getOnProperty().getURI()); for (Resource inst : rest.listInstances().toList() ) { log.trace(" "+inst.getURI()); } } } catch (IllegalStateException e) { log.debug("Status of reasoner could not be determined. It is likely disabled", e); } }

Target:
private void printRestrictions() { try { TBoxReasonerModule reasoner = ApplicationUtils.instance().getTBoxReasonerModule(); for (Restriction rest : reasoner.listRestrictions() ) { if (rest.isAllValuesFromRestriction()) { log.trace("All values from: "); AllValuesFromRestriction avfr = rest.asAllValuesFromRestriction(); Resource res = avfr.getAllValuesFrom(); if (res.canAs(OntClass.class)) { OntClass resClass = res.as(OntClass.class); for (Resource inst : resClass.listInstances().toList() ) { log.trace(" -"+inst.getURI()); } } } else if (rest.isSomeValuesFromRestriction()) { log.trace("Some values from: "); } else if (rest.isHasValueRestriction()) { log.trace("Has value: "); } log.trace("On property "+rest.getOnProperty().getURI()); for (Resource inst : rest.listInstances().toList() ) { log.trace(" "+inst.getURI()); } } } catch (IllegalStateException e) { log.warn("Status of reasoner could not be determined. It is likely disabled", e); } }
Source:
public void writeObject(ObjectOutput output, Map<Object, Object> map) throws IOException { Optional<Map.Entry<Object, Object>> found = Optional.empty(); for (Map.Entry<Object, Object> objectObjectEntry : map.entrySet()) { found = Optional.of(objectObjectEntry); break; } Map.Entry<Object, Object> entry = found.get(); output.writeObject(entry.getKey()); output.writeObject(entry.getValue()); }

Target:
public void writeObject(ObjectOutput output, Map<Object, Object> map) throws IOException { final Map.Entry<Object, Object> entry = map.entrySet().iterator().next(); output.writeObject(entry.getKey()); output.writeObject(entry.getValue()); }
Source:
private void performInternalCompactionIfNecessary(TableReference tableRef, SweepResults results) { if (results.getStaleValuesDeleted() > 0) { Stopwatch watch = Stopwatch.createStarted(); kvs.compactInternally(tableRef); long elapsedMillis = watch.elapsed(TimeUnit.MILLISECONDS); log.info("Finished performing compactInternally on in ms.", UnsafeArg.of("table name", tableRef), SafeArg.of("", elapsedMillis)); sweepPerfLogger.logInternalCompaction( SweepCompactionPerformanceResults.builder() .tableName(tableRef.getQualifiedName()) .cellsDeleted(results.getStaleValuesDeleted()) .cellsExamined(results.getCellTsPairsExamined()) .elapsedMillis(elapsedMillis) .build()); } }

Target:
private void performInternalCompactionIfNecessary(TableReference tableRef, SweepResults results) { if (results.getStaleValuesDeleted() > 0) { Stopwatch watch = Stopwatch.createStarted(); kvs.compactInternally(tableRef); long elapsedMillis = watch.elapsed(TimeUnit.MILLISECONDS); log.debug("Finished performing compactInternally on in ms.", UnsafeArg.of("table name", tableRef), SafeArg.of("elapsedMillis", elapsedMillis)); sweepPerfLogger.logInternalCompaction( SweepCompactionPerformanceResults.builder() .tableName(tableRef.getQualifiedName()) .cellsDeleted(results.getStaleValuesDeleted()) .cellsExamined(results.getCellTsPairsExamined()) .elapsedMillis(elapsedMillis) .build()); } }
Source:
GC100IRConnection(InetAddress ipAddress, String ipAddressString, int port, int module, int connector, String deviceType, Socket socket) throws IOException { this.inetAddress = ipAddress; this.ipAddressString = ipAddressString; this.port = port; this.module = module; this.connector = connector; this.deviceType = deviceType; this.socket = socket; this.isConnected = true; }

Target:
GC100IRConnection(InetAddress ipAddress, String ipAddressString, int port, int module, int connector, String deviceType, Socket socket) { this.inetAddress = ipAddress; this.ipAddressString = ipAddressString; this.port = port; this.module = module; this.connector = connector; this.deviceType = deviceType; this.socket = socket; this.isConnected = true; }
Source:
public void setClientCapabilites(List<String> clientCapabilites){ this.mClientCapabilites = clientCapabilites; }

Target:
public void setClientCapabilites(List<String> clientCapabilites){ mClientCapabilites = clientCapabilites; }
Source:
public SynchronizeTimeResponse getSynchronizeTimeResponse( @OrganisationIdentification final String organisationIdentification, @RequestPayload final SynchronizeTimeAsyncRequest request) throws OsgpException { final MeterResponseData meterResponseData = this.adhocService.dequeueSynchronizeTimeResponse(request .getCorrelationUid()); final SynchronizeTimeResponse response = new SynchronizeTimeResponse(); if (meterResponseData != null) { response.setResult(OsgpResultType.fromValue(meterResponseData.getResultType().getValue())); if (meterResponseData.getMessageData() instanceof String) { response.setDescription((String) meterResponseData.getMessageData()); } } else { response.setResult(OsgpResultType.NOT_FOUND); } return response; }

Target:
public SynchronizeTimeResponse getSynchronizeTimeResponse( @OrganisationIdentification final String organisationIdentification, @RequestPayload final SynchronizeTimeAsyncRequest request) { final SynchronizeTimeResponse response = new SynchronizeTimeResponse(); try { final MeterResponseData meterResponseData = this.adhocService.dequeueSynchronizeTimeResponse(request .getCorrelationUid()); response.setResult(OsgpResultType.fromValue(meterResponseData.getResultType().getValue())); if (meterResponseData.getMessageData() instanceof String) { response.setDescription((String) meterResponseData.getMessageData()); } } catch (final FunctionalException e) { if (e.getExceptionType() == FunctionalExceptionType.UNKNOWN_CORRELATION_UID) { response.setResult(OsgpResultType.NOT_FOUND); } else { response.setResult(OsgpResultType.NOT_OK); } } return response; }
Source:
public void handlesSocket() throws IOException { final Socket socket = createMockSocket( Joiner.on(BkBasicTest.CRLF).join( "GET /1 HTTP/1.1", "Host: localhost", "Content-Length: 1", "", "hi1" ) ); final ByteArrayOutputStream baos = new ByteArrayOutputStream(); Mockito.when(socket.getOutputStream()).thenReturn(baos); new BkBasic(new TkText("Hello world!")).accept(socket); MatcherAssert.assertThat( baos.toString(), Matchers.containsString("Hello world") ); }

Target:
public void handlesSocket() throws IOException { final Socket socket = new Socket.FakeSocket( Joiner.on(BkBasicTest.CRLF).join( "GET /1 HTTP/1.1", "Host: localhost", "Content-Length: 1", "", "hi1" ) ); new BkBasic(new TkText("Hello world!")).accept(socket); MatcherAssert.assertThat( socket.output().toString(), Matchers.containsString("Hello world") ); }
Source:
public void testConnectionSuspendedHandlingDuringInitialization() throws Exception { QueueLeaderElectionListener queueLeaderElectionListener = new QueueLeaderElectionListener(1, Duration.ofMillis(50)); LeaderRetrievalDriver leaderRetrievalDriver = null; try { leaderRetrievalDriver = ZooKeeperUtils .createLeaderRetrievalDriverFactory(zooKeeperClient, config) .createLeaderRetrievalDriver(queueLeaderElectionListener, fatalErrorHandler); CompletableFuture<String> firstAddress = queueLeaderElectionListener.next(); assertThat("No results are expected, yet, since no leader was elected.", firstAddress, is(nullValue())); closeTestServer(); final CompletableFuture<String> secondAddress = queueLeaderElectionListener.next(Duration.ofSeconds(3)); assertThat("The next result must not be missing.", secondAddress, is(notNullValue())); assertThat("The next result is expected to be null.", secondAddress.get(), is(nullValue())); } finally { if (leaderRetrievalDriver != null) { leaderRetrievalDriver.close(); } } }

Target:
public void testConnectionSuspendedHandlingDuringInitialization() throws Exception { final QueueLeaderElectionListener queueLeaderElectionListener = new QueueLeaderElectionListener(1); LeaderRetrievalDriver leaderRetrievalDriver = null; try { leaderRetrievalDriver = ZooKeeperUtils .createLeaderRetrievalDriverFactory(zooKeeperClient, config) .createLeaderRetrievalDriver(queueLeaderElectionListener, fatalErrorHandler); final CompletableFuture<String> firstAddress = queueLeaderElectionListener.next(Duration.ofMillis(50)); assertThat("No results are expected, yet, since no leader was elected.", firstAddress, is(nullValue())); closeTestServer(); final CompletableFuture<String> secondAddress = queueLeaderElectionListener.next(); assertThat("The next result must not be missing.", secondAddress, is(notNullValue())); assertThat("The next result is expected to be null.", secondAddress.get(), is(nullValue())); } finally { if (leaderRetrievalDriver != null) { leaderRetrievalDriver.close(); } } }
Source:
public <E extends Enum<E>> E readEnumValue(Class<E> enumClass) { E[] enums = enumClass.getEnumConstants(); if (enums.length == 0) { throw new IllegalArgumentException(); } int index; if (enums.length > 1) { int length = MathHelper.log2DeBruijn(enums.length); index = readFixedBits(length); } else { index = 0; } return enums[index]; }

Target:
public <E extends Enum<E>> E readEnumValue(Class<E> enumClass) { E[] enums = enumClass.getEnumConstants(); if (enums == null) throw new IllegalArgumentException("Not an enum " + enumClass); if (enums.length == 0) throw new IllegalArgumentException("Tried to read an enum value without any values! How did you do this?"); if (enums.length == 1) return enums[0]; int length = MathHelper.log2DeBruijn(enums.length); int index = readFixedBits(length); return enums[index]; }
Source:
public static void getPresignedObjectUrl_test2() throws Exception { String methodName = "getPresignedObjectUrl(GetPresignedObjectUrlArgs args)"; if (!mintEnv) { System.out.println("Test: presigned get object with expiry: " + methodName); } long startTime = System.currentTimeMillis(); try { String objectName = getRandomName(); try (final InputStream is = new ContentInputStream(1 * KB)) { client.putObject(bucketName, objectName, is, new PutObjectOptions(1 * KB, -1)); } byte[] inBytes; try (final InputStream is = new ContentInputStream(1 * KB)) { inBytes = readAllBytes(is); } String urlString = client.getPresignedObjectUrl( GetPresignedObjectUrlArgs.builder() .method(Method.GET) .bucket(bucketName) .object(objectName) .expires(3600) .build()); byte[] outBytes = readObject(urlString); if (!Arrays.equals(inBytes, outBytes)) { throw new Exception("object content differs"); } client.removeObject(RemoveObjectArgs.builder().bucket(bucketName).object(objectName).build()); mintSuccessLog(methodName, "presigned get object expiry :3600 sec ", startTime); } catch (Exception e) { handleException(methodName, "presigned get object expiry :3600 sec ", startTime, e); } }

Target:
public static void getPresignedObjectUrl_test2() throws Exception { String methodName = "getPresignedObjectUrl(GetPresignedObjectUrlArgs args)"; if (!mintEnv) { System.out.println("Test: " + methodName + " presigned get with expiry"); } long startTime = System.currentTimeMillis(); String mintArgs = "expiry: 3600 sec"; try { String objectName = getRandomName(); try (final InputStream is = new ContentInputStream(1 * KB)) { client.putObject(bucketName, objectName, is, new PutObjectOptions(1 * KB, -1)); } byte[] inBytes; try (final InputStream is = new ContentInputStream(1 * KB)) { inBytes = readAllBytes(is); } String urlString = client.getPresignedObjectUrl( GetPresignedObjectUrlArgs.builder() .method(Method.GET) .bucket(bucketName) .object(objectName) .expiry(3600) .build()); byte[] outBytes = readObject(urlString); if (!Arrays.equals(inBytes, outBytes)) { throw new Exception("object content differs"); } client.removeObject(RemoveObjectArgs.builder().bucket(bucketName).object(objectName).build()); mintSuccessLog(methodName, mintArgs, startTime); } catch (Exception e) { handleException(methodName, mintArgs, startTime, e); } }
Source:
public void logIn(final String message, @Nullable final IGoogleLoginCompletedCallback callback) { final GoogleLoginState state = createGoogleLoginState(); new Task.Modal(null, "Please Log in...", true) { private boolean loggedIn = false; @Override public void run(@NotNull ProgressIndicator indicator) { indicator.setIndeterminate(true); if (!(indicator instanceof ProgressIndicatorEx)) return; ((ProgressIndicatorEx)indicator).addStateDelegate(new ProgressIndicatorBase() { @Override public void cancel() { assert uiFacade != null; uiFacade.stop(); super.cancel(); } }); loggedIn = state.logInWithLocalServer(message); } @Override public void onCancel() { notifyOnComplete(); } @Override public void onSuccess() { notifyOnComplete(); } private void notifyOnComplete() { if(loggedIn) { IGoogleLoginCompletedCallback localCallback = new IGoogleLoginCompletedCallback() { @Override public void onLoginCompleted() { uiFacade.notifyStatusIndicator(); if(callback != null) { callback.onLoginCompleted(); } } }; users.addUser(new CredentialedUser(state, localCallback)); } else if (callback != null) { callback.onLoginCompleted(); } } }.queue(); }

Target:
public void logIn(final String message, @Nullable final IGoogleLoginCompletedCallback callback) { final GoogleLoginState state = createGoogleLoginState(); new Task.Modal(null, "Please Log in...", true) { private boolean loggedIn = false; @Override public void run(@NotNull ProgressIndicator indicator) { indicator.setIndeterminate(true); if (!(indicator instanceof ProgressIndicatorEx)) { return; } ((ProgressIndicatorEx)indicator).addStateDelegate(new ProgressIndicatorBase() { @Override public void cancel() { assert uiFacade != null; uiFacade.stop(); super.cancel(); } }); loggedIn = state.logInWithLocalServer(message); } @Override public void onCancel() { notifyOnComplete(); } @Override public void onSuccess() { notifyOnComplete(); } private void notifyOnComplete() { if(loggedIn) { IGoogleLoginCompletedCallback localCallback = new IGoogleLoginCompletedCallback() { @Override public void onLoginCompleted() { uiFacade.notifyStatusIndicator(); if(callback != null) { callback.onLoginCompleted(); } } }; users.addUser(new CredentialedUser(state, localCallback)); } else if (callback != null) { callback.onLoginCompleted(); } } }.queue(); }
Source:
public void testCmdRegistration() throws Exception { CommandLineExecutorService cles = Framework.getLocalService(CommandLineExecutorService.class); assertNotNull(cles); deployContrib("org.nuxeo.ecm.platform.commandline.executor", "OSGI-INF/commandline-aspell-test-contribs.xml"); applyInlineDeployments(); List<String> cmds = cles.getRegistredCommands(); assertNotNull(cmds); assertEquals(1, cmds.size()); assertTrue(cmds.contains("aspell")); deployContrib("org.nuxeo.ecm.platform.commandline.executor", "OSGI-INF/commandline-imagemagic-test-contrib.xml"); applyInlineDeployments(); cmds = cles.getRegistredCommands(); assertNotNull(cmds); assertEquals(2, cmds.size()); assertTrue(cmds.contains("identify")); deployContrib("org.nuxeo.ecm.platform.commandline.executor", "OSGI-INF/commandline-imagemagic-test-contrib2.xml"); applyInlineDeployments(); cmds = cles.getRegistredCommands(); assertNotNull(cmds); assertEquals(1, cmds.size()); assertFalse(cmds.contains("identify")); }

Target:
public void testCmdRegistration() throws Exception { CommandLineExecutorService cles = Framework.getLocalService(CommandLineExecutorService.class); assertNotNull(cles); pushInlineDeployments( "org.nuxeo.ecm.platform.commandline.executor:OSGI-INF/commandline-aspell-test-contribs.xml"); List<String> cmds = cles.getRegistredCommands(); assertNotNull(cmds); assertEquals(1, cmds.size()); assertTrue(cmds.contains("aspell")); pushInlineDeployments( "org.nuxeo.ecm.platform.commandline.executor:OSGI-INF/commandline-imagemagic-test-contrib.xml"); cmds = cles.getRegistredCommands(); assertNotNull(cmds); assertEquals(2, cmds.size()); assertTrue(cmds.contains("identify")); pushInlineDeployments( "org.nuxeo.ecm.platform.commandline.executor:OSGI-INF/commandline-imagemagic-test-contrib2.xml"); cmds = cles.getRegistredCommands(); assertNotNull(cmds); assertEquals(1, cmds.size()); assertFalse(cmds.contains("identify")); }
Source:
public static ArrayList<Geometry> findBorders(Pixmap pm, double threshold, double distanceTolerance) { final int w = pm.getWidth(); final int h = pm.getHeight(); double[][] area = new double[w + 4][h + 4]; for (int x = 0; x < w; x++) { double[] column = area[x + 2]; for (int y = 0; y < h; y++) { int p = pm.getPixel(x, h - y - 1); column[y + 2] = (p & 0xff) * 1.0 / 256; } } ArrayList<ArrayList<Point2D>> contours = new ArrayList<ArrayList<Point2D>>(); MarchingSquares.calculateContour(contours, area, 1, threshold); ArrayList<Geometry> geo = new ArrayList<Geometry>(); for (ArrayList<Point2D> contour : contours) { float[] vs = new float[contour.size() * 2]; int i = 0; for (Point2D p : contour) { vs[i++] = (float) p.getX() - 1; vs[i++] = (float) p.getY() - 1; } geo.add(gdxToJts(new Polygon(vs))); } simplify(geo, distanceTolerance); return geo; }

Target:
public static Array<Geometry> findBorders(Pixmap pm, double threshold, double distanceTolerance) { final int w = pm.getWidth(); final int h = pm.getHeight(); double[][] area = new double[w + 4][h + 4]; for (int x = 0; x < w; x++) { double[] column = area[x + 2]; for (int y = 0; y < h; y++) { int p = pm.getPixel(x, h - y - 1); column[y + 2] = (p & 0xff) * 1.0 / 256; } } Array<Array<Vector2>> contours = new Array<Array<Vector2>>(); MarchingSquares.calculateContour(contours, area, 1, threshold); Array<Geometry> geo = new Array<Geometry>(); for (Array<Vector2> contour : contours) { float[] vs = new float[contour.size * 2]; int i = 0; for (Vector2 p : contour) { vs[i++] = (float) p.x - 1; vs[i++] = (float) p.y - 1; } geo.add(gdxToJts(new Polygon(vs))); } simplify(geo, distanceTolerance); return geo; }
Source:
public void setup() { conf = new ClientConfiguration(); client = new MockUrlHttpClient(conf); server = DefaultHttpProxyServer.bootstrap() .withPort(8080) .start(); }

Target:
public void setup() { conf = new ClientConfiguration(); client = new MockUrlHttpClient(conf); }
Source:
private TaxonConceptInstance getResolvedAccepted(TaxonConceptInstance original, int steps, @Nullable List<TaxonomicElement> trace, boolean exception) { if (steps <= 0) { if (exception) throw new ResolutionException("Detected possible loop resolving accepted " + original, trace); return original; } TaxonConceptInstance resolved = this.getResolved(original, steps - 1); TaxonomicElement ae = resolved.getAccepted(); if (ae == null || ae == resolved) return resolved; if (trace != null && trace.contains(ae)) { trace.add(ae); if (exception) throw new ResolutionException("Detected possible loop resolving accepted " + original, trace); return original; } if (trace != null) trace.add(ae); TaxonConceptInstance accepted = ae.getRepresentative(); accepted = accepted.getResolvedAccepted(original, steps - 1, trace, exception); if (!accepted.isForbidden()) return accepted; return accepted.getResolvedParent(original, steps - 1, trace, exception); }

Target:
private TaxonConceptInstance getResolvedAccepted(TaxonConceptInstance original, int steps, @Nullable List<TaxonomicElement> trace, boolean exception) { if (steps <= 0) { if (exception) throw new ResolutionException("Detected possible loop resolving accepted " + original, trace); return original; } TaxonConceptInstance resolved = this.getResolved(original, steps - 1); if (resolved == null) { if (exception) throw new ResolutionException("Detected dangling resolution resolving accepted " + original, trace); return original; } TaxonomicElement ae = resolved.getAccepted(); if (ae == null || ae == resolved) return resolved; if (trace != null && trace.contains(ae)) { trace.add(ae); if (exception) throw new ResolutionException("Detected possible loop resolving accepted " + original, trace); return original; } if (trace != null) trace.add(ae); TaxonConceptInstance accepted = ae.getRepresentative(); accepted = accepted.getResolvedAccepted(original, steps - 1, trace, exception); if (!accepted.isForbidden()) return accepted; return accepted.getResolvedParent(original, steps - 1, trace, exception); }
Source:
public GetMastersResponse getMasters(RpcController rpcController, GetMastersRequest request) throws ServiceException { GetMastersResponse.Builder resp = GetMastersResponse.newBuilder(); Optional<ServerName> serverName = master.getActiveMaster(); serverName.ifPresent(name -> resp.addMasterServers(GetMastersResponseEntry.newBuilder() .setServerName(ProtobufUtil.toServerName(name)).setIsActive(true).build())); try { for (ServerName backupMaster: master.getBackupMasters()) { resp.addMasterServers(GetMastersResponseEntry.newBuilder().setServerName( ProtobufUtil.toServerName(backupMaster)).setIsActive(false).build()); } } catch (InterruptedIOException e) { LOG.error("Interrupted during getMasters() RPC.", e); } return resp.build(); }

Target:
public GetMastersResponse getMasters(RpcController rpcController, GetMastersRequest request) throws ServiceException { GetMastersResponse.Builder resp = GetMastersResponse.newBuilder(); Optional<ServerName> serverName = master.getActiveMaster(); serverName.ifPresent(name -> resp.addMasterServers(GetMastersResponseEntry.newBuilder() .setServerName(ProtobufUtil.toServerName(name)).setIsActive(true).build())); for (ServerName backupMaster: master.getBackupMasters()) { resp.addMasterServers(GetMastersResponseEntry.newBuilder().setServerName( ProtobufUtil.toServerName(backupMaster)).setIsActive(false).build()); } return resp.build(); }
Source:
public PlanNodeCostEstimate visitAggregation(AggregationNode node, Void context) { PlanNodeStatsEstimate aggregationStats = getStats(node); PlanNodeStatsEstimate sourceStats = getStats(node.getSource()); double cpuCost = sourceStats.getOutputSizeInBytes(node.getSource().getOutputSymbols(), types); double memoryCost = aggregationStats.getOutputSizeInBytes(node.getOutputSymbols(), types); return new PlanNodeCostEstimate(cpuCost, memoryCost, memoryCost, 0); }

Target:
public PlanNodeCostEstimate visitAggregation(AggregationNode node, Void context) { if (node.getStep() != FINAL && node.getStep() != SINGLE) { return PlanNodeCostEstimate.unknown(); } PlanNodeStatsEstimate aggregationStats = getStats(node); PlanNodeStatsEstimate sourceStats = getStats(node.getSource()); double cpuCost = sourceStats.getOutputSizeInBytes(node.getSource().getOutputSymbols(), types); double memoryCost = aggregationStats.getOutputSizeInBytes(node.getOutputSymbols(), types); return new PlanNodeCostEstimate(cpuCost, memoryCost, 0); }
Source:
public EventHubConsumerOptions clone() { EventHubConsumerOptions clone; try { clone = (EventHubConsumerOptions) super.clone(); } catch (CloneNotSupportedException e) { clone = new EventHubConsumerOptions(); } if (retry != null) { try { clone.retry((Retry) retry.clone()); } catch (CloneNotSupportedException e) { logger.asWarning().log("Unable to create clone of retry.", e); clone.retry(retry); } } clone.scheduler(this.scheduler()); clone.identifier(this.identifier()); clone.prefetchCount(this.prefetchCount()); clone.ownerLevel(this.ownerLevel()); return clone; }

Target:
public EventHubConsumerOptions clone() { EventHubConsumerOptions clone; try { clone = (EventHubConsumerOptions) super.clone(); } catch (CloneNotSupportedException e) { clone = new EventHubConsumerOptions(); } if (retry != null) { try { clone.retry((Retry) retry.clone()); } catch (CloneNotSupportedException e) { logger.error("Unable to create clone of retry.", e); clone.retry(retry); } } clone.scheduler(this.scheduler()); clone.identifier(this.identifier()); clone.prefetchCount(this.prefetchCount()); clone.ownerLevel(this.ownerLevel()); return clone; }
Source:
public ToolNBT() { durability = 0; harvestLevel = 0; attack = 0; speed = 0; attackSpeed = 0; }

Target:
public ToolNBT() { durability = 0; harvestLevel = 0; attack = 0; speed = 0; attackSpeedMultiplier = 1; }
Source:
List<String> genArgs() { return asList( "-d", "-p", "crate.pid", String.format("-Des.cluster.name=%s", clusterName), String.format("-Des.http.port=%d", configuration.httpPort), String.format("-Des.transport.tcp.port=%d", configuration.transportPort), String.format("-Des.node.name=%s", nodeNode), String.format("-Des.discovery.zen.ping.multicast.enabled=%s", "false"), String.format("-Des.discovery.zen.ping.unicast.hosts=%s", unicastHosts()) ); }

Target:
List<String> genArgs() { return asList( String.format("-Des.cluster.name=%s", clusterName), String.format("-Des.http.port=%d", configuration.httpPort), String.format("-Des.transport.tcp.port=%d", configuration.transportPort), String.format("-Des.node.name=%s", nodeNode), String.format("-Des.discovery.zen.ping.multicast.enabled=%s", "false"), String.format("-Des.discovery.zen.ping.unicast.hosts=%s", unicastHosts()) ); }
Source:
public void testReadUncalledSegments() { final File testDir = new File("src/test/resources/org/broadinstitute/hellbender/tools/exome/caller"); final File testSegments = new File(testDir,"segments.tsv"); List<SimpleInterval> segments = SegmentUtils.readIntervalsFromSegmentFile(testSegments); Assert.assertEquals(segments.size(), 4); Assert.assertEquals(segments.get(0).getContig(), "chr"); Assert.assertEquals(segments.get(1).getStart(), 300); Assert.assertEquals(segments.get(2).getEnd(), 550); }

Target:
public void testReadUncalledSegments() { final List<SimpleInterval> segments = SegmentUtils.readIntervalsFromSegmentFile(TEST_SEGMENTS); Assert.assertEquals(segments.size(), 4); Assert.assertEquals(segments.get(0).getContig(), "chr"); Assert.assertEquals(segments.get(1).getStart(), 300); Assert.assertEquals(segments.get(2).getEnd(), 550); }
Source:
private void finalizeINodeFileUnderConstruction(String src, INodeFile pendingFile) throws IOException { boolean skipReplicationCheck = false; if (pendingFile.getStoragePolicyID() == HdfsConstants.DB_STORAGE_POLICY_ID){ skipReplicationCheck = true; } finalizeINodeFileUnderConstructionInternal(src, pendingFile, skipReplicationCheck); }

Target:
private void finalizeINodeFileUnderConstruction(String src, INodeFile pendingFile) throws IOException { finalizeINodeFileUnderConstructionInternal(src, pendingFile, false); }
Source:
public void performAlign(int offset, int width) { int total = fSashForm.getBounds().width; int timeAxisOffset = Math.min(offset, total); int width1 = Math.max(0, timeAxisOffset - fSashForm.getSashWidth()); int width2 = total - timeAxisOffset; if (width1 + width2 > 0) { fSashForm.setWeights(new int[] { width1, width2 }); } fSashForm.layout(); Composite composite = fTimeGraphViewer.getTimeAlignedComposite(); GridLayout layout = (GridLayout) composite.getLayout(); int timeBasedControlsWidth = composite.getSize().x; int marginSize = timeBasedControlsWidth - width; layout.marginRight = Math.max(0, marginSize); composite.layout(); }

Target:
public void performAlign(int offset, int width) { int total = fSashForm.getBounds().width; int timeAxisOffset = Math.min(offset, total); int width1 = Math.max(0, timeAxisOffset - fSashForm.getSashWidth()); int width2 = total - timeAxisOffset; if (width1 >= 0 && width2 > 0 || width1 > 0 && width2 >= 0) { fSashForm.setWeights(new int[] { width1, width2 }); fSashForm.layout(); } Composite composite = fTimeGraphViewer.getTimeAlignedComposite(); GridLayout layout = (GridLayout) composite.getLayout(); int timeBasedControlsWidth = composite.getSize().x; int marginSize = timeBasedControlsWidth - width; layout.marginRight = Math.max(0, marginSize); composite.layout(); }
Source:
protected GenericRecord decodeMessage(byte[] value, String topic, SpecificDatumReader<GenericRecord> reader) throws IOException { if (value.length > 1 && value[0] == 0) { return schemaRegistryClient.decodeMessage(topic, value); } else { return deserializeAvroRecord(decoderFactory, reader, value); } }

Target:
protected GenericRecord decodeMessage(byte[] value, String topic, SpecificDatumReader<GenericRecord> reader) throws IOException { if (value.length > 5 && value[0] == 0) { return schemaRegistryClient.decodeMessage(topic, value); } else { return deserializeAvroRecord(reader, value); } }
Source:
public void testUpdateComment() throws Exception { FileService fileService = new FileService(); authenticateEndpoint(fileService.getEndpoint(), USERNAME, PASSWORD); FileList listOfFiles = fileService.getMyFiles(); String fileId = listOfFiles.get(0).getFileId(); Comment commentObject = fileService.createComment(fileId, "CommentCreated" + System.currentTimeMillis()); if(commentObject != null) { String commentId = commentObject.getCommentId(); fileService.updateComment(fileId, commentId, commentObject.getComment()+"Vimal"); } }

Target:
public void testUpdateComment() throws Exception { FileService fileService = new FileService(); authenticateEndpoint(fileService.getEndpoint(), USERNAME, PASSWORD); FileList listOfFiles = fileService.getMyFiles(); String fileId = listOfFiles.get(0).getFileId(); Comment commentObject = fileService.createComment(fileId, "CommentCreated" + System.currentTimeMillis()); if(commentObject != null) { String commentId = commentObject.getCommentId(); fileService.updateComment(fileId, commentId, commentObject.getComment()+ System.currentTimeMillis()); } }
Source:
public void testUnboundActionRequest() throws Exception { final TestOlingo4ResponseHandler<HttpStatusCode> responseHandler = new TestOlingo4ResponseHandler<>(); olingoApp.action(edm, TEST_UNBOUND_ACTION_RESETDATASOURCE, null, null, responseHandler); final HttpStatusCode statusCode = responseHandler.await(15, TimeUnit.MINUTES); assertEquals(204, statusCode.getStatusCode()); }

Target:
public void testUnboundActionRequest() throws Exception { final TestOlingo4ResponseHandler<HttpStatusCode> responseHandler = new TestOlingo4ResponseHandler<>(); olingoApp.action(edm, TEST_UNBOUND_ACTION_RESETDATASOURCE, null, null, responseHandler); final HttpStatusCode statusCode = responseHandler.await(); assertEquals(HttpStatusCode.NO_CONTENT, statusCode); }
Source:
public void simple3Row() throws Exception { rowPriorityResolver.set( 1, 0 ); rowPriorityResolver.set( 2, 0 ); rowPriorityResolver.set( 3, 2 ); final RowPriorities priorities = rowPriorityResolver.getPriorityRelations(); assertEquals( 1, priorities.getSalience( new RowNumber( 1 ) ).getSalience() ); assertEquals( 0, priorities.getSalience( new RowNumber( 2 ) ).getSalience() ); assertEquals( 1, priorities.getSalience( new RowNumber( 3 ) ).getSalience() ); }

Target:
public void simple3Row() throws Exception { rowPriorityResolver.set(1, 0); rowPriorityResolver.set(2, 0); rowPriorityResolver.set(3, 2); priorities = rowPriorityResolver.getPriorityRelations(); assertSalience(2, new RowNumber(1)); assertSalience(0, new RowNumber(2)); assertSalience(1, new RowNumber(3)); }
Source:
private QueryEngineHTTP(String serviceURI, Query query, String queryString, HttpClient client) { this.query = query; this.queryString = queryString; this.service = serviceURI; this.context = ARQ.getContext(); applyServiceConfig(serviceURI, this); if (client != null) setClient(client); }

Target:
private QueryEngineHTTP(String serviceURI, Query query, String queryString, HttpClient client) { this.query = query; this.queryString = queryString; this.service = serviceURI; this.context = ARQ.getContext().copy(); applyServiceConfig(serviceURI, this); if (client != null) setClient(client); }
Source:
protected ActionResult execute() throws EntityDoesNotExistException { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); new GateKeeper().verifyAccessible( logic.getInstructorForGoogleId(courseId, account.googleId), logic.getFeedbackSession(feedbackSessionName, courseId), false, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); String[] usersToRemind = getRequestParamValues("usersToRemind"); if (usersToRemind == null || usersToRemind.length == 0) { statusToUser.add(Const.StatusMessages.FEEDBACK_SESSION_REMINDERSEMPTYRECIPIENT); return createRedirectResult(Const.ActionURIs.INSTRUCTOR_FEEDBACKS_PAGE); } logic.sendReminderForFeedbackSessionParticularUsers(courseId, feedbackSessionName, usersToRemind); statusToUser.add(Const.StatusMessages.FEEDBACK_SESSION_REMINDERSSENT); statusToAdmin = "Email sent out to the selected student(s) in " + "Feedback Session <span class=\"bold\">(" + feedbackSessionName + ")</span> " + "of Course <span class=\"bold\">[" + courseId + "]</span>"; return createRedirectResult(Const.ActionURIs.INSTRUCTOR_FEEDBACKS_PAGE); }

Target:
protected ActionResult execute() throws EntityDoesNotExistException { String courseId = getRequestParamValue(Const.ParamsNames.COURSE_ID); String feedbackSessionName = getRequestParamValue(Const.ParamsNames.FEEDBACK_SESSION_NAME); new GateKeeper().verifyAccessible( logic.getInstructorForGoogleId(courseId, account.googleId), logic.getFeedbackSession(feedbackSessionName, courseId), false, Const.ParamsNames.INSTRUCTOR_PERMISSION_MODIFY_SESSION); String[] usersToRemind = getRequestParamValues("usersToRemind"); if (usersToRemind == null || usersToRemind.length == 0) { statusToUser.add(Const.StatusMessages.FEEDBACK_SESSION_REMINDERSEMPTYRECIPIENT); return createRedirectResult(Const.ActionURIs.INSTRUCTOR_FEEDBACKS_PAGE); } logic.sendReminderForFeedbackSessionParticularUsers(courseId, feedbackSessionName, usersToRemind); statusToUser.add(Const.StatusMessages.FEEDBACK_SESSION_REMINDERSSENT); statusToAdmin = "Email sent out to the selected user(s): "; for(String user : usersToRemind){ statusToAdmin += "<br>" + user; } statusToAdmin += "<br>in Feedback Session <span class=\"bold\">(" + feedbackSessionName + ")</span> " + "of Course <span class=\"bold\">[" + courseId + "]</span>"; return createRedirectResult(Const.ActionURIs.INSTRUCTOR_FEEDBACKS_PAGE); }
Source:
public Flux<PartitionOwnership> listOwnership(String fullyQualifiedNamespace, String eventHubName, String consumerGroup) { String prefix = getBlobPrefix(fullyQualifiedNamespace, eventHubName, consumerGroup, OWNERSHIP_PATH); BlobListDetails details = new BlobListDetails().setRetrieveMetadata(true); ListBlobsOptions options = new ListBlobsOptions().setPrefix(prefix).setDetails(details); return blobContainerAsyncClient.listBlobs(options) .filter(blobItem -> blobItem.getName().split(BLOB_PATH_SEPARATOR).length == 5) .map(this::convertToPartitionOwnership); }

Target:
public Flux<PartitionOwnership> listOwnership(String fullyQualifiedNamespace, String eventHubName, String consumerGroup) { String prefix = getBlobPrefix(fullyQualifiedNamespace, eventHubName, consumerGroup, OWNERSHIP_PATH); return listBlobs(prefix, this::convertToPartitionOwnership); }
Source:
public URI convert(URI inputFileUri, SchemaFormat baseFormat, SchemaFormat resultFormat) { if (resultFormat == SchemaFormat.DMS) { return null; } else if (resultFormat == SchemaFormat.DMSRUSDML) { return null; } else { return null; } }

Target:
public URI convert(URI inputFileUri, SchemaFormat baseFormat, SchemaFormat resultFormat) { if (resultFormat == SchemaFormat.DMS) { throw new RuntimeException("Not implemented yet!"); } else if (resultFormat == SchemaFormat.DMSRUSDML) { throw new RuntimeException("Not implemented yet!"); } else { throw new RuntimeException("Not implemented yet!"); } }
Source:
public List<Dac> findDacsByUser(AuthUser authUser) { if (isAuthUserAdmin(authUser)) { List<Dac> allDacs = dacDAO.findAll(); return allDacs; } List<Dac> dacs = dacDAO.findDacsForEmail(authUser.getGoogleUser().getEmail()); return dacs; }

Target:
public List<Dac> findDacsByUser(AuthUser authUser) { if (isAuthUserAdmin(authUser)) { List<Dac> allDacs = dacDAO.findAll(); return allDacs; } List<Dac> dacs = dacDAO.findDacsForEmail(authUser.getName()); return dacs; }
Source:
public void testVFE9() { T_filled_new_array_range_11 t = new T_filled_new_array_range_11(); try { t.run(); fail("expected NoClassDefFoundError exception"); } catch (NoClassDefFoundError e) { } }

Target:
public void testVFE9() { T_filled_new_array_range_11 t = new T_filled_new_array_range_11(); try { t.run(); fail("expected IllegalAccessError exception"); } catch (IllegalAccessError e) { } }
Source:
private static List<String> loadFileContent(String path, SourceType sourceType) throws IOException { checkPathAndMode(path, sourceType); log.debug("loading with sourceType {}", path, sourceType); BufferedReader reader = null; try { reader = ShifuFileUtils.getReader(path, sourceType); List<String> content = new ArrayList<String>(); String line = null; while((line = reader.readLine()) != null) { content.add(line); } return content; } finally { IOUtils.closeQuietly(reader); } }

Target:
private static List<String> loadFileContent(String path, SourceType sourceType) throws IOException { checkPathAndMode(path, sourceType); log.debug("loading with sourceType {}", path, sourceType); BufferedReader reader = null; try { reader = ShifuFileUtils.getReader(path, sourceType); List<String> contents = new ArrayList<String>(); String line = null; while((line = reader.readLine()) != null) { contents.add(line); } return contents; } finally { IOUtils.closeQuietly(reader); } }
Source:
public boolean isNewborn() { if (getCreated() == null) { return false; } Date now = new Date(); Date oneDayFromRegistration = new Date(getCreated().getTime() + 24L * 60L * 60L * 1000L); return now.before(oneDayFromRegistration); }

Target:
public boolean isNewborn() { if (getCreated() == null) { return false; } Instant oneDayFromRegistration = getCreated().toInstant().plus(Duration.ofDays(1)); return Instant.now().isBefore(oneDayFromRegistration); }
Source:
private void startInvocation( IInvocationContext context, ExecutableCommand cmd, IScheduledInvocationListener... listeners) { initInvocation(); throwIfDeviceInInvocationThread(context.getDevices()); CLog.d("starting invocation for command id %d", cmd.getCommandTracker().getId()); final String invocationName = String.format("Invocation-%s", context.getSerials().get(0)); InvocationThread invocationThread = new InvocationThread(invocationName, context, cmd, listeners); cmd.getCommandTracker().getContexts().add(context); logInvocationStartedEvent(cmd.getCommandTracker(), context); invocationThread.start(); addInvocationThread(invocationThread); }

Target:
private void startInvocation( IInvocationContext context, ExecutableCommand cmd, IScheduledInvocationListener... listeners) { initInvocation(); throwIfDeviceInInvocationThread(context.getDevices()); int invocationId = cmd.getCommandTracker().getId(); CLog.d("starting invocation for command id %d", invocationId); final String invocationName = String.format("Invocation-%s", context.getSerials().get(0)); InvocationThread invocationThread = new InvocationThread(invocationName, context, cmd, listeners); if (context instanceof InvocationContext) { ((InvocationContext) context).setInvocationId(invocationId); } logInvocationStartedEvent(cmd.getCommandTracker(), context); invocationThread.start(); addInvocationThread(invocationThread); }
Source:
public TxEntryCacheSet(VisitableCommand rCommand, CacheSet<CacheEntry<K, V>> set, InvocationContext rCtx, boolean isRemoteIteration) { super(Caches.getCacheWithFlags(TxInterceptor.this.cache, (FlagAffectedCommand) rCommand), set); this.rCtx = rCtx; this.isRemoteIteration = isRemoteIteration; }

Target:
TxEntryCacheSet(VisitableCommand rCommand, CacheSet<CacheEntry<K, V>> set, InvocationContext rCtx, boolean isRemoteIteration) { super(Caches.getCacheWithFlags(TxInterceptor.this.cache, (FlagAffectedCommand) rCommand), set); this.rCtx = rCtx; this.isRemoteIteration = isRemoteIteration; }
Source:
public void shouldNotReturnNullFileCacheEntries() throws IOException { File file = FileUtils.getResourceFileFromContext("test-data/hello.doc"); assertNotNull(file); assertTrue(file.length() > 0); Blob blob = Blobs.createBlob(file, "application/msword", null, "hello.doc"); BlobHolder bh = new SimpleCachableBlobHolder(blob); String cacheKey = CacheKeyGenerator.computeKey("identity", bh, null); ConversionCacheHolder.addToCache(cacheKey, bh); assertEquals(1, ConversionCacheHolder.getNbCacheEntries()); BlobHolder blobHolder = ConversionCacheHolder.getFromCache(cacheKey); Files.delete(Paths.get(blobHolder.getBlob().getFile().getPath())); assertEquals(1, ConversionCacheHolder.getNbCacheEntries()); assertTrue(ConversionCacheHolder.getCacheKeys().contains(cacheKey)); assertNull(ConversionCacheHolder.getFromCache(cacheKey)); assertEquals(0, ConversionCacheHolder.getNbCacheEntries()); }

Target:
public void shouldNotReturnNullFileCacheEntries() throws IOException { File file = FileUtils.getResourceFileFromContext("test-data/hello.doc"); Blob blob = Blobs.createBlob(file); BlobHolder bh = new SimpleCachableBlobHolder(blob); String cacheKey = CacheKeyGenerator.computeKey("identity", bh, null); ConversionCacheHolder.addToCache(cacheKey, bh); assertEquals(1, ConversionCacheHolder.getNbCacheEntries()); BlobHolder blobHolder = ConversionCacheHolder.getFromCache(cacheKey); Files.delete(Paths.get(blobHolder.getBlob().getFile().getPath())); assertEquals(1, ConversionCacheHolder.getNbCacheEntries()); assertTrue(ConversionCacheHolder.getCacheKeys().contains(cacheKey)); assertNull(ConversionCacheHolder.getFromCache(cacheKey)); assertEquals(0, ConversionCacheHolder.getNbCacheEntries()); }
Source:
protected void marshallAndAssertArrayEquality(Object[] writeObj) throws Exception { byte[] bytes = marshaller.objectToByteBuffer(writeObj); System.out.println(bytes.length); Object[] readObj = (Object[]) marshaller.objectFromByteBuffer(bytes); assertArrayEquals("Writen[" + Arrays.toString(writeObj)+ "] and read[" + Arrays.toString(readObj)+ "] objects should be the same", readObj, writeObj); }

Target:
protected void marshallAndAssertArrayEquality(Object[] writeObj) throws Exception { byte[] bytes = marshaller.objectToByteBuffer(writeObj); log.debugf("Payload size for object=%s : %s", Arrays.toString(writeObj), bytes.length); Object[] readObj = (Object[]) marshaller.objectFromByteBuffer(bytes); assertArrayEquals("Writen[" + Arrays.toString(writeObj) + "] and read[" + Arrays.toString(readObj) + "] objects should be the same", readObj, writeObj); }
Source:
private String getType(String filename) { String type = filename.substring(filename.lastIndexOf('.') + 1); boolean hash = false; String hashAlgorithm = null; if (filename.endsWith(".sha1")) { type = filename.substring(0, filename.length() - 5); type = type.substring(type.lastIndexOf('.') + 1) + ".sha1"; } if (filename.endsWith(".md5")) { type = filename.substring(0, filename.length() - 4); type = type.substring(type.lastIndexOf('.') + 1) + ".md5"; } return type; }

Target:
private String getType(String filename) { if (filename.contains(".")) { String type = filename.substring(filename.lastIndexOf('.') + 1); if (filename.endsWith(".sha1")) { type = filename.substring(0, filename.length() - 5); type = type.substring(type.lastIndexOf('.') + 1) + ".sha1"; } if (filename.endsWith(".md5")) { type = filename.substring(0, filename.length() - 4); type = type.substring(type.lastIndexOf('.') + 1) + ".md5"; } return type; } else { return null; } }
Source:
public void testOverrideIndicatorText() { testCountOverrideIndicators(); for (Annotation fOverrideAnnotation : fOverrideAnnotations) { String text= fOverrideAnnotation.getText(); assertTrue(text != null && (text.equals("overrides java.lang.Object.toString") || text.equals("implements junit.framework.Test.run") || text.equals("implements junit.framework.Test.countTestCases") )); } }

Target:
public void testOverrideIndicatorText() { testCountOverrideIndicators(); for (Annotation overrideAnnotation : fOverrideAnnotations) { String text= overrideAnnotation.getText(); assertTrue(text != null && (text.equals("overrides java.lang.Object.toString") || text.equals("implements junit.framework.Test.run") || text.equals("implements junit.framework.Test.countTestCases") )); } }
Source:
public boolean handleNetworkException(VDSNetworkException ex, VDS vds) { if (vds.getStatus() != VDSStatus.Down) { long timeoutToFence = calcTimeoutToFence(vds.getVmCount(), vds.getSpmStatus()); if (mUnrespondedAttempts.get() < Config.<Integer> GetValue(ConfigValues.VDSAttemptsToResetCount) || (lastUpdate + timeoutToFence) > System.currentTimeMillis()) { boolean result = false; if (vds.getStatus() != VDSStatus.Connecting && vds.getStatus() != VDSStatus.PreparingForMaintenance && vds.getStatus() != VDSStatus.NonResponsive) { setStatus(VDSStatus.Connecting, vds); result = true; } mUnrespondedAttempts.incrementAndGet(); return result; } if (vds.getStatus() == VDSStatus.NonResponsive || vds.getStatus() == VDSStatus.Maintenance) { setStatus(VDSStatus.NonResponsive, vds); return true; } setStatus(VDSStatus.NonResponsive, vds); log.infoFormat( "Server failed to respond, vds_id = {0}, vds_name = {1}, vm_count = {2}, " + "spm_status = {3}, non-responsive_seconds = {4}, error = {5}", vds.getId(), vds.getName(), vds.getVmCount(), vds.getSpmStatus(), TimeUnit.MILLISECONDS.toSeconds(timeoutToFence), ex.getMessage()); AuditLogableBase logable = new AuditLogableBase(vds.getId()); AuditLogDirector.log(logable, AuditLogType.VDS_FAILURE); ResourceManager.getInstance().getEventListener().vdsNotResponding(vds); } return true; }

Target:
public boolean handleNetworkException(VDSNetworkException ex, VDS vds) { if (vds.getStatus() != VDSStatus.Down) { long timeoutToFence = calcTimeoutToFence(vds.getVmCount(), vds.getSpmStatus()); if (mUnrespondedAttempts.get() < Config.<Integer> GetValue(ConfigValues.VDSAttemptsToResetCount) || (lastUpdate + timeoutToFence) > System.currentTimeMillis()) { boolean result = false; if (vds.getStatus() != VDSStatus.Connecting && vds.getStatus() != VDSStatus.PreparingForMaintenance && vds.getStatus() != VDSStatus.NonResponsive) { setStatus(VDSStatus.Connecting, vds); result = true; } mUnrespondedAttempts.incrementAndGet(); return result; } if (vds.getStatus() == VDSStatus.NonResponsive || vds.getStatus() == VDSStatus.Maintenance) { setStatus(VDSStatus.NonResponsive, vds); return true; } setStatus(VDSStatus.NonResponsive, vds); log.infoFormat( "Server failed to respond, vds_id = {0}, vds_name = {1}, vm_count = {2}, " + "spm_status = {3}, non-responsive_timeout (seconds) = {4}, error = {5}", vds.getId(), vds.getName(), vds.getVmCount(), vds.getSpmStatus(), TimeUnit.MILLISECONDS.toSeconds(timeoutToFence), ex.getMessage()); AuditLogableBase logable = new AuditLogableBase(vds.getId()); AuditLogDirector.log(logable, AuditLogType.VDS_FAILURE); ResourceManager.getInstance().getEventListener().vdsNotResponding(vds); } return true; }
Source:
public ArchaiusConfigurationProvider(Map<String, String> variableValues) { super(new ObjectMapper()); this.variableValues = Maps.newHashMap(variableValues); this.configurationManager = ConfigurationManager.getConfigInstance(); this.propertyFactory = DynamicPropertyFactory.getInstance(); this.ownershipPolicy = new ConfigurationOwnershipPolicy() { @Override public boolean has(ConfigurationKey key, Map<String, String> variables) { return configurationManager.containsKey(key.getKey(variables)); } }; }

Target:
public ArchaiusConfigurationProvider(Map<String, String> variableValues) { this.variableValues = Maps.newHashMap(variableValues); this.configurationManager = ConfigurationManager.getConfigInstance(); this.propertyFactory = DynamicPropertyFactory.getInstance(); this.ownershipPolicy = new ConfigurationOwnershipPolicy() { @Override public boolean has(ConfigurationKey key, Map<String, String> variables) { return configurationManager.containsKey(key.getKey(variables)); } }; }